Compare commits

..
Author SHA1 Message Date
Milan Hanajik 031060eca6 Reconfigured for CEVAK 40 2018-12-14 09:31:54 +01:00
Milan Hanajik bb8b4a6fd6 Munich 14.12.2018: Table (fixed column widths), MunichPrintDocument (up to 5 pages, flow calculation, etc), bug fixes, ver. 2.18.1094 2018-12-14 09:30:52 +01:00
Milan Hanajik 1b7dbec443 IZRAEL_25 : Processing this symbol added, component added, ver. 2.18.1089 2018-12-12 19:30:19 +01:00
Milan Hanajik 6f8ad1638f StateMachine : Inserted two 1/10 sec. delays between RunDeviceBefore(), RunOperations() and RunDeviceAfter(). 2018-12-12 11:36:05 +01:00
Milan Hanajik 695cca6509 Statistics project added, ver. 2.18.1088 2018-12-12 11:29:06 +01:00
Milan Hanajik 9417415781 Output.DB.SensusOracle.Database : Q2CORRECTIONLEFT and Q2CORRECTIONRIGHT in VT_IP_ZAEHLER_PINDEX_PD swapped, ver. 2.18.1088 2018-12-10 15:23:41 +01:00
Milan Hanajik a626cec54e ZODINO symbol handled, Elde component for Zodino added, ver. 2.18.1087 2018-12-06 14:49:52 +01:00
Milan Hanajik 4419c5361c iPerlHead : iPerl flow direction evaluation uses max. and min. slope (=flow). 2018-12-05 08:29:11 +01:00
Milan Hanajik 70f3dbbf5d iPerlHead : iPerl flow direction detection fine tuning, ver. 2.18.1086 2018-12-04 10:06:10 +01:00
Milan Hanajik 0e37e7217d iPerl flow direction detection : Change of flow direction supported, ver. 2.18.1085 2018-12-04 08:58:46 +01:00
Milan Hanajik 5f4cf04edb iPerl flow direction detection and display, ver. 2.18.1082 2018-12-03 18:46:42 +01:00
Milan Hanajik 58fad28546 Component for SLM END upgraded, 30.11.2018, position of temperature meters changed, ver. 2.18.1081 2018-11-30 08:58:15 +01:00
Milan Hanajik c783967d87 ver. 2.18.1080 2018-11-29 14:34:17 +01:00
Milan Hanajik b0c95c0677 Output.FileWriters.IperlLogger : Request from Joachim in email 28.11.2018 11:18, ver. 2.18.1079 2018-11-28 13:06:01 +01:00
Milan Hanajik 439f20bc95 Modbus.UltrasoundLevelMeter : (1) telegrams with distance==0 are ignored, (2) IVolumeMeter interface removed, ver. 2.18.1078 2018-11-28 13:00:53 +01:00
Milan Hanajik 7576a68651 CEVAK-200 reverted to version dated 13.11.2018 2018-11-28 10:53:23 +01:00
Milan Hanajik b6380ff896 DataEntry.Standard6 : remarkTextBoxes --> remarkComboBoxes with history, ver. 2.18.1077 2018-11-28 10:47:48 +01:00
Milan Hanajik c3fd5b9366 CEVAK_200 & FlyingStart[Tank|Mass]Collection : Water stopped immediately after test, before measuring the volume/mass. 2018-11-27 07:49:17 +01:00
Milan Hanajik aa24558d07 DataEntry.Standard6.CycleBeginningForm: Remark added, Results.ItemID: WM_remark, etc. added, ver. 2.18.1076 2018-11-26 14:00:44 +01:00
Milan Hanajik 40d4c74493 Bug fix in SequenceBase : FEWA-50 was crashing in Adjustment when T div was not defined), ver. 2.18.1075 2018-11-26 09:54:46 +01:00
Milan Hanajik bc89faf220 ver. 2.18.1074 2018-11-21 07:51:58 +01:00
Milan Hanajik 0b12e79820 FlyingStartMassCollComparative : Reference mass measurement error should be within 3%, ver. 2.18.1073 2018-11-21 07:16:08 +01:00
Milan Hanajik 7bdb7f99d4 FlyingStarMassCollComparative : Mass updated when comparative measurement done, ver. 2.18.1072 2018-11-20 17:49:58 +01:00
Milan Hanajik afea809b97 TestMethods.FlyingStartMassCollComparative.Sigle/Compound/HeatMeters added, ver. 2.18.1071 2018-11-20 17:11:22 +01:00
Milan Hanajik 3122f6dd9a Components upgraded: CEVAK-200 19.11.18 - logging of commands, FEWA-50 19.11.18 - control of valves for mass calibration, ver. 2.18.1070 2018-11-20 14:07:29 +01:00
Milan Hanajik a2f0781fb4 ver. 2.18.1068 2018-11-19 08:23:27 +01:00
Milan Hanajik 31a684f03a (1) DataEntry.iPerl.CycleBeginningForm displays iPerl dir. (2) iPerlCommFrm: CalLNA logged ok (3) FlyStMassCollProlonged and SmryResults modif, ver. 2.18.1067 2018-11-16 14:30:58 +01:00
Milan Hanajik 89eddaa3c2 Transition sequence before test is executed also between two test repetitions, ver. 2.198.1066 2018-11-14 16:41:58 +01:00
Milan Hanajik b060068a95 (1) Nivotrack.ReadStableLevelOp implemented, (2) MettlerToledo.Standard.ReadStableMassOp bug fix, (3) UpdateWeights() clean-up, ver. 2.18.1065 2018-11-14 15:49:43 +01:00
Milan Hanajik 3ffdf4e2cc WaitTankContainsMoreThenOp, related Various.TankWithLevelMsrmnt and TankDraining changes, ver. 2.18.1064 2018-11-14 13:07:37 +01:00
Milan Hanajik 7d1d95305f Transition between two repetitions added. 2018-11-14 08:23:01 +01:00
Milan Hanajik 98fc15a709 bool TestParams.ManualLevelMsrmnt added to ...TankCollection methods, is used in sequnces, ver. 2.18.1062 2018-11-13 18:02:57 +01:00
Milan Hanajik a8e0a8087d Stable level and volume measurement ... in progress. 2018-11-13 16:31:20 +01:00
Milan Hanajik f81c30f072 Elde component updated, water tower tank volume display, 13.11.2018 2018-11-13 15:29:19 +01:00
Milan Hanajik 05f6c8c75c UpdateTankWeightOp removed, ver. 2.18.1061 2018-11-13 15:29:18 +01:00
Milan Hanajik 76a08324b4 CtrlBrd.UpdateWeights() updates also tanks, is used in CtrlBrd.RunDeviceAfter(), UpdteTankWeightOp becomes obsolete, ver. 2.18.1060 2018-11-13 15:29:05 +01:00
Milan Hanajik 2a98c485ef ILevelMeter.Level (immediate measurement), Nivotrack uses correction table, etc. 2018-11-13 10:00:09 +01:00
Milan Hanajik 872409870e MetrologyDlgLevelMeterTab added. 2018-11-13 09:42:23 +01:00
Milan Hanajik f48a71ce12 UiBridge.Bridge.CloseModelessFormHandler isn't used, tank draining before a test is optional, fixes in simulations, ver. 2.18.1056 2018-11-12 16:57:28 +01:00
Milan Hanajik d2d571945c ver. 2.18.1055 2018-11-09 17:03:45 +01:00
Milan Hanajik bd9c3aa5e2 Q2 correction for Suez (RL, LR) modified, 'Q2 correction check Q2bc Q2ac' test method implemented. 2018-11-09 16:25:54 +01:00
Milan Hanajik 73ea0ff586 Previous results display software version, ver. 2.18.1054 2018-11-09 11:25:18 +01:00
Milan Hanajik 78408ed5eb Density calculated from (T up + T dn) / 2 and (Pr up + Pr dn) / 2 used everywhere, ver. 2.18.1053 2018-11-08 13:45:01 +01:00
Milan Hanajik f04cdccd20 EtPulsesK (FlyingStartMassCollectionProlonged) fixed for IPERL_TURA and IPERL_SPECIAL, ver. 2.18.1052 2018-11-08 10:41:05 +01:00
Milan Hanajik 82acf60f2e Target flow range for flow control shrinked by 15% from each side, ver. 2.18.2051 2018-11-08 09:54:40 +01:00
Milan Hanajik 68413867ad FlyingStartMassCollectionProlonged fixed for iPerlSpecial, ver. 2.18.1050 2018-11-07 16:28:36 +01:00
Milan Hanajik 1fd8881d53 LastError added to MeterTestRslt, result items, etc. when ORACLE_DB defined, etc. (CalibFactorLNA, OrigCalibFactorLNA) 2018-11-07 08:43:36 +01:00
Milan Hanajik cebdd71065 MID pulses for each meter calculated correctly in all FlyingStart... methods for datastream meters. 2018-11-07 08:13:48 +01:00
Milan Hanajik 668304cb72 Bug fix in Statistics : Min, Max calculation and UpdateGraph( ), ver. 2.18.1049 2018-11-06 13:39:49 +01:00
Milan Hanajik c28c5a5554 Bug fix in Various.TankWithLevelMsrmnt.Tank. 2018-11-02 10:17:52 +01:00
Milan Hanajik 450493069c (1) SequenceBase.DrainTheTank( ) : DrainValve2 is open first, DrainValve in the 2nd half, (2) Two phase draining in MainSeq when bench is started, ver. 2.18.1047 2018-10-26 11:21:07 +02:00
Milan Hanajik d7519aa95a Draining with 2 drain valves in SequenceBase. 2018-10-25 19:44:54 +02:00
Milan Hanajik e89ab89874 TankCfgCtrl displays ILevelMeter-s, DrainValve2 is in IScaleOrTank and TankWithLevelMsrmnt UI, ver. 2.18.1046 2018-10-25 18:09:08 +02:00
Milan Hanajik 025fa81941 SequencBase : ReadRegistersTempPressAmbient( ) fixed - works OK without an IScale - start/stop method works with a tank, ver.2.18.1045 2018-10-25 17:02:12 +02:00
Milan Hanajik 845c66b511 HART communication : IHart,Hart, Nivotrack changes, sending/receiving works OK. Todo: Interface the level, ver. 2.18.1044 2018-10-25 15:34:48 +02:00
Milan Hanajik 3725e238fc Various.TankWithLevelMsrmnt can use a calibration table loaded from a CSV file. 2018-10-25 15:34:46 +02:00
Milan Hanajik ac2ac82187 Diverter fixed for CEVAK_200, ver. 2.18.1042 2018-10-24 17:16:56 +02:00
Milan Hanajik 5e6be0c4b4 (1) Bug fix in calculations in flying start methods when WMPulses == 1, (2) VolumeCTV results item added, ver. 2.18.1041 2018-10-24 15:04:51 +02:00
Milan Hanajik ed66c6a259 (1) Tank & ManualLevelMsrmnt components added, (2) Sequences cope with IScaleOrTank, (3) FixedStartTankCollection & FlyingStartTankCollection added, etc., ver. 2.18.1040 2018-10-24 13:18:38 +02:00
Milan Hanajik 0db7736247 Minor fix in TestMethods.FlyingStart.FlyingStartSeq. 2018-10-23 19:45:53 +02:00
Milan Hanajik 02cebe0966 CEVAK 200 Elde component upgraded: 23.10.2018, I4 and I5 fixed. 2018-10-23 13:13:26 +02:00
Milan Hanajik 4f2bb6291f Strings, ver. 2.18.1036 2018-10-21 10:58:38 +02:00
Milan Hanajik 498c8afbe4 ver. 2.18.1035 2018-10-18 12:57:09 +02:00
Milan Hanajik 0e6dce4750 Error limits before Q2 correction are not shifted to target, factor 1.0 used for Q2CorrType.RL and Q2CorrType.LR, ver. 2.18.1034 2018-10-18 09:28:35 +02:00
Milan Hanajik 7a74579c8b Q2 correction RL and LR addresses swapped, Q2 correction value multiplied by 0.5, ver. 2.18.1033 2018-10-17 14:41:07 +02:00
Milan Hanajik c23630a980 Separate addresses Q2CorrFactorsAddrRL (0x1878) and Q2CorrFactorsAddrLR (0x1879), ver. 2.18.1031 2018-10-17 11:31:28 +02:00
Milan Hanajik 205df83c1c Test sequences modified, Q2CorrRFlow and Q2CorrLFlow set in iPerlCommunicationForm only, ver. 2.18.1030 2018-10-17 09:56:01 +02:00
Milan Hanajik b26f65dab4 (1) Diverter : Fixed 'flowMtrNr4Cmd' for FUZHOU_100, (2) SendCalibData(..., MeretModbus=0xff), ver. 2.18.1029 2018-10-16 10:22:04 +02:00
Milan Hanajik 8d1ac8f41d (1) 'Max_test_index' added to Results, (2) "Max.test index" added to BenchInfoEx, (3) ResultsTabPageCtrl draws NOK wm-s with max. test index in 'Orange', (4) bug fix in ProductionTracing simulation, ver. 2.18.1027 2018-10-15 14:42:17 +02:00
Milan Hanajik 115916fd36 ver. 2.18.1026 2018-10-15 13:20:36 +02:00
Milan Hanajik 6641ed9d96 Bug fix in iPerlHead.CalibTarget property, ver. 2.18.1025 2018-10-15 13:09:30 +02:00
Milan Hanajik 5e3d408706 IsRemoteDBCompatible( ) copes with no remote DB connection, ver. 2.18.1024 2018-10-14 21:58:40 +02:00
Milan Hanajik 8fc9e3e5ce On screen results arrangement : MinWidth, MinHeight. 2018-10-13 06:24:20 +02:00
Milan Hanajik e7aa9731d0 (1) DataEntry.Std6,12,24,48: Excl. mark behaviour, (2) Kepno component upgraded (12.10.2018), (3) TestMet.PulsesTest: OK btn removed, ver. 2.18.1023 2018-10-12 16:04:06 +02:00
Milan Hanajik 0fc63655e9 iPerlHead modification : 'nominalTestFlowLph' calculated from q2adjTestData, test method sequences simplified, ver. 2.18.1021 2018-10-12 13:25:21 +02:00
Milan Hanajik 86b47cb434 ProcedureDlg : History TAB in progress. 2018-10-11 13:53:24 +02:00
Milan Hanajik b3ec97d95c TestMethods.SensitivityTest : Clean-up, in progress. 2018-10-11 11:06:51 +02:00
Milan Hanajik 1620758545 E1 error indicator modified, average flow calculated from CTV volume and test time verified, ver. 2.18.1019 2018-10-11 10:58:08 +02:00
Milan Hanajik 5a2d51db95 Statistics.Start( ) has argument 'skippedsamplesCount', constructor sets 'DefaultSkippedSamplesCount', all FixedStart methods use Math.Max(5, (int)(TstTime/10)), other methods 0, ver. 2.18.1018 2018-10-11 10:26:02 +02:00
Milan Hanajik c0e99364a4 Result, Test passed and Test done items can be formatted, PassedColorStr( ) has argument 'yesNoFormatOrEmpty', ver. 2.18.1017 2018-10-10 11:13:08 +02:00
Milan Hanajik 371a27c646 Output.FileWriters.IperlLogger.Write bug fix : Qfrom, Qto etc. were missing, ver. 2.18.1016 2018-10-10 08:59:35 +02:00
Milan Hanajik 4a06dcff3e (1) TestMethods.PulsesTest : modeless form closed at the end of test, (2) TestMethods.PulsesTestManual : fixes in form items visibility, ver. 2.18.1015 2018-10-09 13:54:36 +02:00
Milan Hanajik 0f54bf86ac ver. 2.18.1014 2018-10-08 11:39:12 +02:00
Milan Hanajik 921c524f0e Output.FileWriters.IperlLogger.Writer : Bug fixed, data of wm0 were logged for all water meters in the batch, ver. 2.18.1013 2018-10-08 11:00:18 +02:00
Milan Hanajik a8df9b50de (1) SLM_END Elde comp. updated (03.10.2018), (2) Elde.TempMeterMeret component added, (3) MeretRS485Address array size increased for 2 new Meret temp.meters for SLM_END, ver. 2.18.1012 2018-10-05 11:34:34 +02:00
Milan Hanajik 5da9b1e94e Fixed a bug when adding a list of new components using a script file, ver. 2.18.1010 2018-10-03 14:56:42 +02:00
Milan Hanajik 63871c9bcc Changes for IZRAEL_50, DEWA_50 removed (replaced by FEWA_50) 2018-10-03 14:56:30 +02:00
Milan Hanajik e5b61825ff Ultrasound level meter modbus communication completed. 2018-10-01 16:40:42 +02:00
Milan Hanajik 2d484ea993 TBF.BenchControl.Configs.ParamsProvider.ComponentCfgCtrl displays a message box when a parameter is invalid, ver. 2.18.1010 2018-10-01 11:18:35 +02:00
Milan Hanajik b5b7d50742 TestiInfo for Greece added (Q1Q2Q2adjQ3), minor fix in SensusOracle.Database, ver. 2.18.1009 2018-10-01 09:01:36 +02:00
274 changed files with 17827 additions and 4361 deletions
+2
View File
@@ -14,6 +14,8 @@ Results/bin/
Results/obj/
ResultsBrowser/bin/
ResultsBrowser/obj/
Statistics/bin/
Statistics/obj/
TBF/bin/
TBF/obj/
TBFSetup/Debug/
+3 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
<DefineConstants>TRACE;DEBUG;CEVAK_40;LANG_CS</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;SENTEC</DefineConstants>
<DefineConstants>TRACE;CEVAK_40;LANG_CS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -78,6 +78,7 @@
<Compile Include="Entities\IHasName.cs" />
<Compile Include="Entities\IHasValves.cs" />
<Compile Include="Entities\IParamsProvider.cs" />
<Compile Include="Entities\IperlEnums.cs" />
<Compile Include="Entities\MeasurementCorrection.cs" />
<Compile Include="Entities\MetersPath.cs" />
<Compile Include="Entities\OutputPath.cs" />
+8 -2
View File
@@ -20,7 +20,7 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_300 || FUZHOU_150 || PT200IL || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
@@ -32,6 +32,12 @@ namespace Config
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif IZRAEL_50
public const int WMsCount = 40;
public const int LineSize = 10;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_100
public const int WMsCount = 10;
public const int LineSize = 10;
@@ -44,7 +50,7 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
+2 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -58,7 +58,7 @@ namespace Config.Entities
[Description("Remote DB only")] RemoteDBOnly,
[Description("Both DB-s, local 1st")] BothDBsLocalFirst,
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst,
Count,
Count
}
/// <summary>
+36
View File
@@ -0,0 +1,36 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
namespace Config.Entities
{
public enum Side
{
#if LANG_CS
[Description("Levá")] Left,
[Description("Pravá")] Right,
#else
[Description("Left")] Left,
[Description("Right")] Right,
#endif
Count
}
public enum FlowDir
{
R_L,
L_R,
Count
}
public enum OptoHeadState
{
Disabled,
OptoAndDirOK,
OptoNok,
DirNok,
Count
}
}
+5 -2
View File
@@ -12,11 +12,14 @@ namespace Config.Entities
public virtual float Measurement { get; set; }
public virtual float Correction { get; set; }
public MeasurementCorrection() { }
public MeasurementCorrection()
{
RangeIx = 0;
}
public MeasurementCorrection(int rangeIx)
{
RangeIx = rangeIx;
RangeIx = rangeIx;
}
}
}
+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.18.982.0")]
[assembly: AssemblyFileVersion("2.18.982.0")]
[assembly: AssemblyVersion("2.18.1082.0")]
[assembly: AssemblyFileVersion("2.18.1082.0")]
+19 -2
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -9,7 +12,21 @@ namespace Config
{
public static string SignificantDigitsToFmt(double value, int sigDigits)
{
if (sigDigits == 5)
if (sigDigits == 6)
{
if (value >= 99999.5 || value < -99999.5) return "F0";
else if (value >= 9999.95 || value < -9999.95) return "F1";
else if (value >= 999.995 || value < -999.995) return "F2";
else if (value >= 99.9995 || value < -99.9995) return "F3";
else if (value >= 9.99995 || value < -9.99995) return "F4";
else if (value >= 0.999995 || value < -0.999995) return "F5";
else if (value >= 0.0999995 || value < -0.0999995) return "F6";
else if (value >= 0.00999995 || value < -0.00999995) return "F7";
else if (value >= 0.000999995 || value < -0.000999995) return "F8";
else if (value >= 0.0000999995 || value < -0.0000999995) return "F9";
else return "F10";
}
else if (sigDigits == 5)
{
if (value >= 9999.5 || value < -9999.5) return "F0";
else if (value >= 999.95 || value < -999.95) return "F1";
+31 -10
View File
@@ -56,7 +56,10 @@ namespace DeviceTest
static TBF.Boxes.FloatBox floatBox;
static Event evnt;
static TBF.Boxes.DoubleBox dblBox1;
static TBF.Boxes.DoubleBox dblBox2;
static TBF.Boxes.DoubleBox dblBox3;
static Event evnt;
static DeviceTestDlg()
@@ -657,7 +660,12 @@ namespace DeviceTest
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
}
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
//operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
//operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
@@ -681,10 +689,15 @@ namespace DeviceTest
}
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
{
operation21 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation22 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
}
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
//operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
//operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
@@ -708,10 +721,15 @@ namespace DeviceTest
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
{
operation31 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation32 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
//operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
//operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
@@ -720,11 +738,14 @@ namespace DeviceTest
}
while (workerThreadRunning)
int time = 0;
while (workerThreadRunning)
{
Thread.Sleep(1000);
if (workerThreadRunning)
StateMachine.Time = ++time;
if (workerThreadRunning)
{
foreach (var d in tbfDevices) d.RunDeviceBefore();
+2 -2
View File
@@ -72,10 +72,10 @@ namespace DeviceTest
}
/// Configure and start logging
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(LocAppDataDir + log4netConfigFName));
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Path.Combine(LocAppDataDir, log4netConfigFName)));
log = LogManager.GetLogger(typeof(Program));
log.Fatal("--------------------------------------------------------------------------------");
log.Fatal(string.Format("TBF ver.{0}", Version));
log.FatalFormat("DeviceTest ver.{0}", Version);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
+14 -3
View File
@@ -28,6 +28,9 @@ namespace Results.Entities
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
public virtual bool TestDone { get; set; } /// true = test was completed
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
#if ORACLE_DB
public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1
#endif
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
@@ -80,10 +83,18 @@ namespace Results.Entities
public virtual bool IsDataStream() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.DataStream); }
public virtual bool IsManual() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Manual); }
public virtual string PassedColorStr()
public virtual string PassedColorStr(string yesNoFormatOrEmpty)
{
return Utils.PassedColorStr(Passed, Evaluate());
}
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
{
return Utils.PassedColorStr(Passed, Evaluate());
}
else
{
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
}
}
public MeterTestRslt()
{
+2 -1
View File
@@ -25,7 +25,8 @@ namespace Results.Entities
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; }
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
+16 -8
View File
@@ -60,13 +60,13 @@ namespace Results.Entities
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double OrigCalibFactorLNA { get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual double Q2Correction { get; set; } /// !!! obsolete
public virtual int Q2CorrRFlow { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
public virtual int Q2CorrLFlow { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
public virtual int Q2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
public virtual int Q2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
public virtual double Diff2Hz8Hz { get; set; }
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
@@ -151,7 +151,7 @@ namespace Results.Entities
{
ErrorFlagsMode errorFlagsMode;
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr()) : eFlags;
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr(null)) : eFlags;
}
/// <summary>
@@ -211,9 +211,17 @@ namespace Results.Entities
}
public virtual string PassedColorStr()
public virtual string PassedColorStr(string yesNoFormatOrEmpty)
{
return Utils.PassedColorStr(Passed, true);
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
{
return Utils.PassedColorStr(Passed, true);
}
else
{
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
}
}
@@ -344,8 +352,8 @@ namespace Results.Entities
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
Q2CorrectionDone = src.Q2CorrectionDone;
Q2Correction = src.Q2Correction;
Q2CorrRFlow = src.Q2CorrRFlow;
Q2CorrLFlow = src.Q2CorrLFlow;
Q2CorrRL = src.Q2CorrRL;
Q2CorrLR = src.Q2CorrLR;
Q2CorrFlowRight = src.Q2CorrFlowRight;
Diff2Hz8Hz = src.Diff2Hz8Hz;
Hz2CorrectionDone = src.Hz2CorrectionDone;
+11 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
///
using System;
@@ -261,6 +261,16 @@ namespace Results
Bench_address4, /// 226 'Address 4' from IBenchInfo
Bench_address5, /// 227 'Address 5' from IBenchInfo
Max_test_index, /// 228 MaxPruefindex % 100
VolumeCTV, /// 229
/// iPerl
LastError, /// 230 For iPerl previous test result (test with Proefindex-1)
OrigCalibFactorLNA, /// 231
CalibFactorLNA, /// 232
WM_remark, /// 233
Count,
}
}
+4 -2
View File
@@ -25,8 +25,10 @@ namespace Results.Mappings
Map(x => x.Error);
Map(x => x.TestDone);
Map(x => x.Passed);
References(x => x.WaterMeter);
#if ORACLE_DB
Map(x => x.LastError);
#endif
References(x => x.WaterMeter);
References(x => x.TestRslt);
}
}
+7 -7
View File
@@ -31,24 +31,24 @@ namespace Results.Mappings
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
#endif
#if IPERL2
Map(x => x.OrigCalibFactorLNA);
Map(x => x.CalibFactorLNA);
#endif
#if IPERL
Map(x => x.Q2ErrWOCorrection);
Map(x => x.Q2CorrectionDone);
Map(x => x.Q2Correction);
Map(x => x.Q2CorrRFlow);
Map(x => x.Q2CorrLFlow);
Map(x => x.Q2CorrRL).Column("Q2CorrRFlow");
Map(x => x.Q2CorrLR).Column("Q2CorrLFlow");
Map(x => x.Q2CorrFlowRight);
Map(x => x.Diff2Hz8Hz);
Map(x => x.Hz2CorrectionDone);
Map(x => x.Hz2Correction);
Map(x => x.FWVersion);
#endif
References(x => x.WaterMeterData);
#if ORACLE_DB
Map(x => x.Pruefindex);
Map(x => x.HydrPruefung);
#endif
References(x => x.WaterMeterData);
References(x => x.Batch);
HasMany(x => x.MeterTestRslts)
.Cascade.All();
@@ -1,11 +1,13 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
using System.IO;
using Results.Resources;
namespace Results.Output.Printers.Munich
{
@@ -38,11 +40,16 @@ namespace Results.Output.Printers.Munich
readonly int resultsCount;
readonly bool compound; /// true when MetersKind is MetersKind.Combined
/// Top coordinate of the table
int nrPages;
int pageNr;
int firstTblTop;
int secondTblTop;
int pageNr; /// Current page number
int nrPages; /// Total number of pages
float tableTop; /// Top coordinate of the table
int[] firstTblRowsOnPage;
int[] secondTblRowsOnPage;
PageOrientation pageOrientation;
/// <summary>
/// Property variable for the Font the user wishes to use
@@ -51,7 +58,34 @@ namespace Results.Output.Printers.Munich
Font boldFont;
Font fontTitle;
/// <summary>
///
/// Table style
///
static TableStyle tableStyle = new TableStyle
{
Font = new Font(FontFamilyName, 10, FontStyle.Regular),
HeaderFont = new Font(FontFamilyName, 10, FontStyle.Regular),
MarginX = 7,
MarginY = 5,
LineWidth = 1,
TopHeadersCount = 1,
HorizLines = TableLines.FirstSecondAndLast,
VertLines = TableLines.All,
ColumnWidths = new float[] { 150, 70, 75, 75, 70, 75, 75 },
};
static Alignment[] horizontalAlignment = new Alignment[] /// Horizontal alignment of items of one row
{
Alignment.Left, Alignment.Left, Alignment.Left,
Alignment.Left, Alignment.Left, Alignment.Left, Alignment.Left
};
static VertAlignment[] verticalAlignment = new VertAlignment[] /// Vertical alignment of items of one row
{
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle,
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle
};
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
@@ -61,7 +95,8 @@ namespace Results.Output.Printers.Munich
{
this.docVersion = docVersion;
this.wm = wm;
compound = wm.Compound();
this.compound = wm.Compound();
this.pageOrientation = pageOrientation;
string[] info = wm.ProductName().Split(new char[] { ';' });
if (info.Length >= 2)
@@ -81,13 +116,88 @@ namespace Results.Output.Printers.Munich
}
results = wm.MeterTestRslts;
this.resultsCount = compound ? (results.Count / 3) : results.Count;
int resultsCount = wm.MeterTestRslts.Count;
if (compound) resultsCount /= 3;
resultsCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++;
}
pageNr = 1;
nrPages = (compound ? (resultsCount > 7) : (resultsCount > 9)) ? 2 : 1;
if (compound)
{
/// Compound meter results
const int MaxOnFirstPage = 23;
const int MaxOnPage = 45;
if (resultsCount <= 7)
{
nrPages = 1;
firstTblRowsOnPage = new int[] { resultsCount };
secondTblRowsOnPage = new int[] { resultsCount };
}
else if (resultsCount <= MaxOnFirstPage)
{
nrPages = 2;
firstTblRowsOnPage = new int[] { resultsCount, 0 };
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
}
else if (resultsCount <= MaxOnPage)
{
nrPages = 3;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
}
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
{
nrPages = 4;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
}
else
{
nrPages = 5;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
}
}
else
{
/// Regular (single) meter results
const int MaxOnFirstPage = 27;
const int MaxOnPage = 45;
if (resultsCount <= 9)
{
nrPages = 1;
firstTblRowsOnPage = new int[] { resultsCount };
secondTblRowsOnPage = new int[] { resultsCount };
}
else if (resultsCount <= MaxOnFirstPage)
{
nrPages = 2;
firstTblRowsOnPage = new int[] { resultsCount, 0 };
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
}
else if (resultsCount <= MaxOnPage)
{
nrPages = 3;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
}
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
{
nrPages = 4;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
}
else
{
nrPages = 5;
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
}
}
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
}
@@ -116,8 +226,30 @@ namespace Results.Output.Printers.Munich
/// Run base code
base.OnPrintPage(e);
/// Draw 2550 x 3507 'headpic' scaled to A4 at 100 DPI
e.Graphics.DrawImage(Results.Properties.Resources.Headpic, new Rectangle(0, 0, 827, 1137));
if (pageOrientation == PageOrientation.Portrait)
{
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichP.jpg", "C:\\TBF\\Templates\\MunichP.png", "C:\\TBF\\Templates\\MunichP.tif" };
foreach (var t in templatePaths)
{
if (File.Exists(t))
{
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 827, 1169), new Rectangle(0, 0, 827, 1169));
break;
}
}
}
else
{
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichL.jpg", "C:\\TBF\\Templates\\MunichL.png", "C:\\TBF\\Templates\\MunichL.tif" };
foreach (var t in templatePaths)
{
if (File.Exists(t))
{
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 1169, 827), new Rectangle(0, 0, 1169, 827));
break;
}
}
}
/// Set print area size and margins (in dots using 80 dpi)
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
@@ -144,27 +276,21 @@ namespace Results.Output.Printers.Munich
if (pageNr == 1)
{
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
/// This is the first page, drad the title, common part and the 1st table
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
///
/// Common
///
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
lineNr++;
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
DrawCommonTop(e, ref lineNr, wm, pruefvorlage, docVersion);
lineNr += 2;
tableTop = SpacingOne * lineNr;
}
else
{
/// This appears on the top of the 2nd and every subsequent page.
/// 2nd table starts from the top of the page.
lineNr -= 3;
if (compound)
{
@@ -189,228 +315,294 @@ namespace Results.Output.Printers.Munich
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
}
lineNr++;
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
lineNr += 2;
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
}
lineNr += 2;
firstTblTop = SpacingOne * lineNr;
///
/// Table 1
///
PrintTableOne(e, firstTblTop);
DrawTableFrame(e, resultsCount + 1, firstTblTop);
tableTop = TitleY + (compound ? 5 : 4) * SpacingOne;
}
if (firstTblRowsOnPage[pageNr - 1] > 0)
{
int from = 0;
for (int pN = 0; pN < pageNr - 1; pN++) from += firstTblRowsOnPage[pN];
Table table1 = PrepareTableOne(from, from + firstTblRowsOnPage[pageNr - 1] - 1);
tableTop = table1.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
}
if (pageNr == nrPages)
{
if (pageNr == 1)
{
secondTblTop = firstTblTop + (resultsCount + 2) * SpacingOneAndHalf;
lineNr += ((resultsCount + 2) * SpacingOneAndHalf * 2) / SpacingOne;
}
else
{
lineNr -= 3;
if (compound)
{
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
lineNr++;
}
if (secondTblRowsOnPage[pageNr - 1] > 0)
{
int from = 0;
for (int pN = 0; pN < pageNr - 1; pN++) from += secondTblRowsOnPage[pN];
Table table2 = PrepareTableTwo(from, from + secondTblRowsOnPage[pageNr - 1] - 1);
tableTop = table2.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
}
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
}
lineNr++;
if (pageNr == nrPages)
{
int top = topMargin + printHeight - 8 * SpacingOne;
DrawCommonBottom(e, top, wm);
}
else
{
e.HasMorePages = true;
}
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
}
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
secondTblTop = TitleY + (compound ? 5 : 4) * SpacingOne;
}
///
/// Table 2
///
PrintTableTwo(e, secondTblTop);
DrawTableFrame(e, resultsCount + 1, secondTblTop);
///
/// Footer
///
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().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");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, "Datum");
PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift");
}
e.HasMorePages = (pageNr != nrPages);
pageNr++;
}
///
/// Draw a footer and increment the page number
///
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 table texts.
/// Prepares content and style of the first table.
/// </summary>
void PrintTableOne(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
/// <param name="from">0-based index fo the first result to print</param>
/// <param name="to">0-based index fo the last result to print</param>
/// <returns>Prepared table</returns>
Table PrepareTableOne(int from = 0, int to = int.MaxValue)
{
PrintAt(e, GetTabItemPos(0, 0, tblTop), "Prüflauf");
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Prüf-Vol.[l]");
PrintAt(e, GetTabItemPos(0, 3, tblTop), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
PrintAt(e, GetTabItemPos(0, 4, tblTop), compound ? "NZ-Vol.[l]" : "-");
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Fehler [%]");
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Ergebnis");
Table table = new Table(7);
table.Style = tableStyle;
int rowCnt = 1;
string[] tableHeader = new string[]
{
"Prüflauf",
"Q [l/h]",
"Prüf-Vol.[l]",
compound ? "HZ-Vol.[l]" : "Z-Vol.[l]",
compound ? "NZ-Vol.[l]" : "-",
"Fehler [%]",
"Ergebnis",
};
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
int rowCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
PrintAt(e, GetTabItemPos(rowCnt, 0, tblTop), mtr.Name());
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.VolumeCTV.ToString("F2"));
if (compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
if (from <= rowCount && rowCount <= to)
{
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mainMtr.VolumeMeter.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), auxMtr.VolumeMeter.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
}
else
{
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.VolumeMeter.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), "-");
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
}
if (compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
rowCnt++;
table.AddRow(new string[] { mtr.Name(),
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
mtr.TestRslt.VolumeCTV.ToString("F2"),
mainMtr.VolumeMeter.ToString("F2"),
auxMtr.VolumeMeter.ToString("F2"),
mtr.Error.ToString("F2"),
mtr.Passed ? "iO" : "NiO" },
horizontalAlignment,
verticalAlignment);
}
else
{
table.AddRow(new string[] { mtr.Name(),
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
mtr.TestRslt.VolumeCTV.ToString("F2"),
mtr.VolumeMeter.ToString("F2"),
"-",
mtr.Error.ToString("F2"),
mtr.Passed ? "iO" : "NiO" },
horizontalAlignment,
verticalAlignment);
}
}
rowCount++;
}
}
return table;
}
void PrintTableTwo(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
/// <summary>
/// Prepares content and style of the second table.
/// </summary>
/// <param name="from">0-based index fo the first result to print</param>
/// <param name="to">0-based index fo the last result to print</param>
/// <returns>Prepared table</returns>
Table PrepareTableTwo(int from = 0, int to = int.MaxValue)
{
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Temperatur");
PrintAt(e, GetTabItemPos(0, 3, tblTop), "Dichte");
PrintAt(e, GetTabItemPos(0, 4, tblTop), "Prüfzeit");
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Druck Eing.");
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Druck Ausg.");
Table table = new Table(7);
table.Style = tableStyle;
int rowCnt = 1;
string[] tableHeader = new string[]
{
"",
"Q [l/h]",
"Temperatur",
"Dichte",
"Prüfzeit",
"Druck Eing.",
"Druck Ausg.",
};
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
int rowCount = 0;
foreach (var mtr in wm.MeterTestRslts)
{
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
{
Point p = GetTabItemPos(rowCnt, 0, tblTop);
PrintAt(e, p.X, p.Y, mtr.Name());
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
{
if (from <= rowCount && rowCount <= to)
{
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.TempDownMean.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.TestRslt.DensityDiv.ToString("F2"));
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), mtr.TestTime.ToString("F1"));
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
rowCnt++;
}
table.AddRow(new string[] { mtr.Name(),
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
mtr.TestRslt.TempDownMean.ToString("F2"),
mtr.TestRslt.DensityDiv.ToString("F2"),
mtr.TestTime.ToString("F1"),
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"),
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3") },
horizontalAlignment,
verticalAlignment);
}
rowCount++;
}
}
return table;
}
/// <summary>
/// Draw table lines.
/// </summary>
void DrawTableFrame(System.Drawing.Printing.PrintPageEventArgs e, int rowsCount, int tblTop)
{
int t = tblTop;
int m = tblTop + SpacingOneAndHalf;
int b = tblTop + rowsCount * SpacingOneAndHalf;
/// <summary>
/// Prints text on the top of the first page (title, common information).
/// </summary>
/// <param name="e"></param>
/// <param name="lineNr"></param>
/// <param name="wm"></param>
/// <param name="pruefvorlage"></param>
/// <param name="docVersion"></param>
void DrawCommonTop(PrintPageEventArgs e, ref int lineNr, Entities.WaterMeter wm, string pruefvorlage, string docVersion)
{
///
///
///
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
lineNr++;
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
lineNr += 2;
// Horizontal lines
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, t), new Point(747, t));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, m), new Point(747, m));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, b), new Point(747, b));
if (compound)
{
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
lineNr++;
}
// Vertical lines
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, t), new Point( 80, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, t), new Point(267, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, t), new Point(347, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, t), new Point(427, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, t), new Point(507, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, t), new Point(587, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, t), new Point(667, b));
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, t), new Point(747, b));
}
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
}
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
if (compound)
{
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
lineNr += 2;
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
}
}
/// <summary>
/// Prints text at the bottom of the last page (footer).
/// </summary>
/// <param name="e"></param>
/// <param name="lineNr"></param>
/// <param name="wm"></param>
void DrawCommonBottom(PrintPageEventArgs e, float top, Entities.WaterMeter wm)
{
int iTop = (int)top;
PrintAt(e, Tab1, iTop, "Temperatur");
PrintAt(e, Tab2, iTop, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
iTop += SpacingOne;
PrintAt(e, Tab1, iTop, "Feuchtigkeit");
PrintAt(e, Tab2, iTop, wm.Batch.AmbHumiMean().ToString("F0") + " %");
iTop += SpacingOne;
PrintAt(e, Tab1, iTop, "Luftdruck");
PrintAt(e, Tab2, iTop, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
iTop += SpacingOne;
PrintAt(e, Tab3, iTop, wm.Batch.EndTime.Date.ToString("d"));
iTop += SpacingOne;
PrintAt(e, Tab3, iTop, "Datum");
PrintAt(e, Tab4, iTop, "Unterschrift");
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
@@ -434,18 +626,5 @@ namespace Results.Output.Printers.Munich
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
}
/// <summary>
/// Get text position form a number of the test and a number of the parameter.
/// </summary>
/// <param name="row"></param>
/// <param name="column">Table column (0-based)</param>
/// <returns></returns>
Point GetTabItemPos(int row, int column, int tblTop)
{
int x = MarginLeft + ((column == 0) ? 80 : 187) + column * 80; /// leftmost column is wider
int y = MarginTop + tblTop + (row * SpacingOneAndHalf) - 2;
return new Point(x, y);
}
}
}
+9 -1
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
@@ -25,6 +28,7 @@ namespace Results.Output.Printers
public float LineWidth;
public TableLines HorizLines;
public TableLines VertLines;
public float[] ColumnWidths; /// null = automatic
}
public class Table
@@ -154,6 +158,10 @@ namespace Results.Output.Printers
/// In not a separator line
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
if ((Style.ColumnWidths != null) && (Style.ColumnWidths.Length > colIx))
{
size.Width = Style.ColumnWidths[colIx]; /// Override measurement if column width is defined
}
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
}
+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.18.995.0")]
[assembly: AssemblyFileVersion("2.18.995.0")]
[assembly: AssemblyVersion("2.18.1093.0")]
[assembly: AssemblyFileVersion("2.18.1093.0")]
+18
View File
@@ -114,6 +114,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Batch.
/// </summary>
internal static string Batch {
get {
return ResourceManager.GetString("Batch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Batch nr..
/// </summary>
@@ -1059,6 +1068,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of a meter in previous test/in production.
/// </summary>
internal static string Tooltip_E_rel_last {
get {
return ResourceManager.GetString("Tooltip_E_rel_last", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Relative error of the master meter.
/// </summary>
+3
View File
@@ -252,4 +252,7 @@
<data name="Address" xml:space="preserve">
<value>Adresa</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Dávka</value>
</data>
</root>
+6
View File
@@ -735,4 +735,10 @@
<data name="Address" xml:space="preserve">
<value>Address</value>
</data>
<data name="Tooltip_E_rel_last" xml:space="preserve">
<value>Relative error of a meter in previous test/in production</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Batch</value>
</data>
</root>
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
<DefineConstants>TRACE;DEBUG;CEVAK_40;LANG_CS</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;SENTEC</DefineConstants>
<DefineConstants>TRACE;CEVAK_40;LANG_CS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+42 -20
View File
@@ -154,8 +154,9 @@ namespace Results
/// Volume
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.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) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
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) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
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) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
@@ -309,12 +310,14 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).Uncertainty())));
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) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrorMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", Config.Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
#if TURA_IPERL || TURA_SPECIAL
#if ORACLE_DB
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" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.LastError, string.Format("{0} rel. last ()", Strings.VName_Error), Strings.Tooltip_E_rel_last, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).LastError)));
#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) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
#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) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
@@ -398,8 +401,9 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
/// Extra water meter data
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, w.Batch.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_remark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, string.Format("{0} {1}", Strings.Batch, Strings.Remark), Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, w.Batch.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
#if HEAT_METERS
@@ -408,20 +412,25 @@ namespace Results
#endif
#if IPERL
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRFlow)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLFlow)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2CorrRFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2CorrLFlow", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_test_index, "iPerl test index", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, (w.Pruefindex % 100))));
#endif
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).TestDone) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null && w.GetMeterTestRslt(t).Passed) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagsStr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlagsEx, Strings.Error_flags + "Ex", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ErrorFlagsStrEx())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0001) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).TestDone)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).Passed)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagsStr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlagsEx, Strings.Error_flags + "Ex", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ErrorFlagsStrEx())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0001) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0002) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0004) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E4, "E4 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x0008) != 0) ? Strings.Yes : Strings.No));
@@ -454,9 +463,22 @@ namespace Results
return string.IsNullOrEmpty(format) ? value : string.Format(format, value);
}
public static string FormatBool(string format, bool value)
{
if (string.IsNullOrEmpty(format))
{
return value ? Strings.Yes : Strings.No;
}
else
{
string[] yesNo = format.Split(new char[] { '~' });
return value ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Strings.No);
}
}
public static string FormatInt(string format, int value)
{
return string.IsNullOrEmpty(format) ? value.ToString() : string.Format(format, value);
return string.IsNullOrEmpty(format) ? value.ToString() : string.Format(format, value);
}
public static string FormatDbl(Config.Unit units, string format, string precisionOrEmpty, string dfltPrecision, double v)
+3
View File
@@ -237,4 +237,7 @@
<data name="Print" xml:space="preserve">
<value>Vytisknout</value>
</data>
<data name="Add_data_from_Oracle" xml:space="preserve">
<value>Dohledej údaje z Oracle</value>
</data>
</root>
+3
View File
@@ -825,4 +825,7 @@
<data name="Error_exporting_results" xml:space="preserve">
<value>Error exporting results</value>
</data>
<data name="Add_data_from_Oracle" xml:space="preserve">
<value>Add data from Oracle</value>
</data>
</root>
+9
View File
@@ -105,6 +105,15 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Add data from Oracle.
/// </summary>
internal static string Add_data_from_Oracle {
get {
return ResourceManager.GetString("Add_data_from_Oracle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add filter.
/// </summary>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
<DefineConstants>TRACE;DEBUG;CEVAK_40;LANG_CS</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;SENTEC</DefineConstants>
<DefineConstants>TRACE;CEVAK_40;LANG_CS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Statistics
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new StatisticsDlg());
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Statistics")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Statistics")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9e674819-ed89-4d9a-a4e8-3bf2cc69cfc2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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.18.1088.0")]
[assembly: AssemblyFileVersion("2.18.1088.0")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Statistics.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Statistics.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Statistics.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+117
View File
@@ -0,0 +1,117 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Statistics.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Strings {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Strings() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Statistics.Resources.Strings", typeof(Strings).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Flow.
/// </summary>
internal static string Flow {
get {
return ResourceManager.GetString("Flow", resourceCulture);
}
}
/// <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 Statistics.
/// </summary>
internal static string Statistics {
get {
return ResourceManager.GetString("Statistics", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time period.
/// </summary>
internal static string Time_period {
get {
return ResourceManager.GetString("Time_period", resourceCulture);
}
}
/// <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 Water meters.
/// </summary>
internal static string Water_meters {
get {
return ResourceManager.GetString("Water_meters", resourceCulture);
}
}
}
}
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Flow" xml:space="preserve">
<value>Flow</value>
</data>
<data name="From" xml:space="preserve">
<value>From</value>
</data>
<data name="Statistics" xml:space="preserve">
<value>Statistics</value>
</data>
<data name="Time_period" xml:space="preserve">
<value>Time period</value>
</data>
<data name="To" xml:space="preserve">
<value>To</value>
</data>
<data name="Water_meters" xml:space="preserve">
<value>Water meters</value>
</data>
</root>
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Flow" xml:space="preserve">
<value>Prietok</value>
</data>
<data name="From" xml:space="preserve">
<value>Od</value>
</data>
<data name="Statistics" xml:space="preserve">
<value>Štatistiky</value>
</data>
<data name="Time_period" xml:space="preserve">
<value>Časový úsek</value>
</data>
<data name="To" xml:space="preserve">
<value>Do</value>
</data>
<data name="Water_meters" xml:space="preserve">
<value>Vodomery</value>
</data>
</root>
+137
View File
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Statistics</RootNamespace>
<AssemblyName>Statistics</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections">
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="StatisticsDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="StatisticsDlg.Designer.cs">
<DependentUpon>StatisticsDlg.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserControls\Enums.cs" />
<Compile Include="UserControls\MidOrWaterMetersCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\MidOrWaterMetersCtrl.Designer.cs">
<DependentUpon>MidOrWaterMetersCtrl.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\StatisticsCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\StatisticsCtrl.Designer.cs">
<DependentUpon>StatisticsCtrl.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.sk.resx" />
<EmbeddedResource Include="StatisticsDlg.resx">
<DependentUpon>StatisticsDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="UserControls\MidOrWaterMetersCtrl.resx">
<DependentUpon>MidOrWaterMetersCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\StatisticsCtrl.resx">
<DependentUpon>StatisticsCtrl.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Results\Results.csproj">
<Project>{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}</Project>
<Name>Results</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+294
View File
@@ -0,0 +1,294 @@
namespace Statistics
{
partial class StatisticsDlg
{
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.timePeriodGroupBox = new System.Windows.Forms.GroupBox();
this.timePeriodCheckBox = new System.Windows.Forms.CheckBox();
this.toLabel1 = new System.Windows.Forms.Label();
this.fromLabel1 = new System.Windows.Forms.Label();
this.dateTimeFromPicker = new System.Windows.Forms.DateTimePicker();
this.dateTimeToPicker = new System.Windows.Forms.DateTimePicker();
this.midsTabControl = new System.Windows.Forms.TabControl();
this.wr10TabPage = new System.Windows.Forms.TabPage();
this.wr11TabPage = new System.Windows.Forms.TabPage();
this.wr13TabPage = new System.Windows.Forms.TabPage();
this.wr14TabPage = new System.Windows.Forms.TabPage();
this.wr15TabPage = new System.Windows.Forms.TabPage();
this.wmsBenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
this.i1BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
this.i2BbenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
this.i3BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
this.i4BenchesControl = new Statistics.UserControls.MidOrWaterMetersCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.timePeriodGroupBox.SuspendLayout();
this.midsTabControl.SuspendLayout();
this.wr10TabPage.SuspendLayout();
this.wr11TabPage.SuspendLayout();
this.wr13TabPage.SuspendLayout();
this.wr14TabPage.SuspendLayout();
this.wr15TabPage.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.timePeriodGroupBox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.midsTabControl);
this.splitContainer1.Size = new System.Drawing.Size(1368, 826);
this.splitContainer1.SplitterDistance = 90;
this.splitContainer1.TabIndex = 0;
//
// timePeriodGroupBox
//
this.timePeriodGroupBox.Controls.Add(this.timePeriodCheckBox);
this.timePeriodGroupBox.Controls.Add(this.toLabel1);
this.timePeriodGroupBox.Controls.Add(this.fromLabel1);
this.timePeriodGroupBox.Controls.Add(this.dateTimeFromPicker);
this.timePeriodGroupBox.Controls.Add(this.dateTimeToPicker);
this.timePeriodGroupBox.Location = new System.Drawing.Point(12, 10);
this.timePeriodGroupBox.Name = "timePeriodGroupBox";
this.timePeriodGroupBox.Size = new System.Drawing.Size(296, 74);
this.timePeriodGroupBox.TabIndex = 2;
this.timePeriodGroupBox.TabStop = false;
//
// timePeriodCheckBox
//
this.timePeriodCheckBox.AutoSize = true;
this.timePeriodCheckBox.Location = new System.Drawing.Point(6, -2);
this.timePeriodCheckBox.Name = "timePeriodCheckBox";
this.timePeriodCheckBox.Size = new System.Drawing.Size(81, 17);
this.timePeriodCheckBox.TabIndex = 4;
this.timePeriodCheckBox.Text = "Time period";
this.timePeriodCheckBox.UseVisualStyleBackColor = true;
this.timePeriodCheckBox.CheckedChanged += new System.EventHandler(this.timePeriodCheckBox_CheckedChanged);
//
// toLabel1
//
this.toLabel1.AutoSize = true;
this.toLabel1.Location = new System.Drawing.Point(31, 48);
this.toLabel1.Name = "toLabel1";
this.toLabel1.Size = new System.Drawing.Size(20, 13);
this.toLabel1.TabIndex = 3;
this.toLabel1.Text = "To";
//
// fromLabel1
//
this.fromLabel1.AutoSize = true;
this.fromLabel1.Location = new System.Drawing.Point(31, 23);
this.fromLabel1.Name = "fromLabel1";
this.fromLabel1.Size = new System.Drawing.Size(30, 13);
this.fromLabel1.TabIndex = 2;
this.fromLabel1.Text = "From";
//
// dateTimeFromPicker
//
this.dateTimeFromPicker.Location = new System.Drawing.Point(81, 19);
this.dateTimeFromPicker.Name = "dateTimeFromPicker";
this.dateTimeFromPicker.Size = new System.Drawing.Size(200, 20);
this.dateTimeFromPicker.TabIndex = 0;
//
// dateTimeToPicker
//
this.dateTimeToPicker.Location = new System.Drawing.Point(81, 44);
this.dateTimeToPicker.Name = "dateTimeToPicker";
this.dateTimeToPicker.Size = new System.Drawing.Size(200, 20);
this.dateTimeToPicker.TabIndex = 1;
//
// midsTabControl
//
this.midsTabControl.Controls.Add(this.wr10TabPage);
this.midsTabControl.Controls.Add(this.wr11TabPage);
this.midsTabControl.Controls.Add(this.wr13TabPage);
this.midsTabControl.Controls.Add(this.wr14TabPage);
this.midsTabControl.Controls.Add(this.wr15TabPage);
this.midsTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.midsTabControl.Location = new System.Drawing.Point(0, 0);
this.midsTabControl.Name = "midsTabControl";
this.midsTabControl.SelectedIndex = 0;
this.midsTabControl.Size = new System.Drawing.Size(1368, 732);
this.midsTabControl.TabIndex = 0;
//
// wr10TabPage
//
this.wr10TabPage.Controls.Add(this.wmsBenchesControl);
this.wr10TabPage.Location = new System.Drawing.Point(4, 22);
this.wr10TabPage.Name = "wr10TabPage";
this.wr10TabPage.Padding = new System.Windows.Forms.Padding(3);
this.wr10TabPage.Size = new System.Drawing.Size(1360, 706);
this.wr10TabPage.TabIndex = 0;
this.wr10TabPage.Text = "Water meters";
this.wr10TabPage.UseVisualStyleBackColor = true;
//
// wr11TabPage
//
this.wr11TabPage.Controls.Add(this.i1BenchesControl);
this.wr11TabPage.Location = new System.Drawing.Point(4, 22);
this.wr11TabPage.Name = "wr11TabPage";
this.wr11TabPage.Padding = new System.Windows.Forms.Padding(3);
this.wr11TabPage.Size = new System.Drawing.Size(1360, 706);
this.wr11TabPage.TabIndex = 1;
this.wr11TabPage.Text = "I1";
this.wr11TabPage.UseVisualStyleBackColor = true;
//
// wr13TabPage
//
this.wr13TabPage.Controls.Add(this.i2BbenchesControl);
this.wr13TabPage.Location = new System.Drawing.Point(4, 22);
this.wr13TabPage.Name = "wr13TabPage";
this.wr13TabPage.Padding = new System.Windows.Forms.Padding(3);
this.wr13TabPage.Size = new System.Drawing.Size(1360, 706);
this.wr13TabPage.TabIndex = 2;
this.wr13TabPage.Text = "I2";
this.wr13TabPage.UseVisualStyleBackColor = true;
//
// wr14TabPage
//
this.wr14TabPage.Controls.Add(this.i3BenchesControl);
this.wr14TabPage.Location = new System.Drawing.Point(4, 22);
this.wr14TabPage.Name = "wr14TabPage";
this.wr14TabPage.Padding = new System.Windows.Forms.Padding(3);
this.wr14TabPage.Size = new System.Drawing.Size(1360, 706);
this.wr14TabPage.TabIndex = 3;
this.wr14TabPage.Text = "I3";
this.wr14TabPage.UseVisualStyleBackColor = true;
//
// wr15TabPage
//
this.wr15TabPage.Controls.Add(this.i4BenchesControl);
this.wr15TabPage.Location = new System.Drawing.Point(4, 22);
this.wr15TabPage.Name = "wr15TabPage";
this.wr15TabPage.Padding = new System.Windows.Forms.Padding(3);
this.wr15TabPage.Size = new System.Drawing.Size(1360, 706);
this.wr15TabPage.TabIndex = 4;
this.wr15TabPage.Text = "I4";
this.wr15TabPage.UseVisualStyleBackColor = true;
//
// wmsBenchesControl
//
this.wmsBenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.wmsBenchesControl.Location = new System.Drawing.Point(3, 3);
this.wmsBenchesControl.Name = "wmsBenchesControl";
this.wmsBenchesControl.Size = new System.Drawing.Size(1354, 700);
this.wmsBenchesControl.TabIndex = 0;
//
// i1BenchesControl
//
this.i1BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.i1BenchesControl.Location = new System.Drawing.Point(3, 3);
this.i1BenchesControl.Name = "i1BenchesControl";
this.i1BenchesControl.Size = new System.Drawing.Size(1354, 700);
this.i1BenchesControl.TabIndex = 0;
//
// i2BbenchesControl
//
this.i2BbenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.i2BbenchesControl.Location = new System.Drawing.Point(3, 3);
this.i2BbenchesControl.Name = "i2BbenchesControl";
this.i2BbenchesControl.Size = new System.Drawing.Size(1354, 700);
this.i2BbenchesControl.TabIndex = 0;
//
// i3BenchesControl
//
this.i3BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.i3BenchesControl.Location = new System.Drawing.Point(3, 3);
this.i3BenchesControl.Name = "i3BenchesControl";
this.i3BenchesControl.Size = new System.Drawing.Size(1354, 700);
this.i3BenchesControl.TabIndex = 0;
//
// i4BenchesControl
//
this.i4BenchesControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.i4BenchesControl.Location = new System.Drawing.Point(3, 3);
this.i4BenchesControl.Name = "i4BenchesControl";
this.i4BenchesControl.Size = new System.Drawing.Size(1354, 700);
this.i4BenchesControl.TabIndex = 0;
//
// StatisticsDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1368, 826);
this.Controls.Add(this.splitContainer1);
this.Name = "StatisticsDlg";
this.Text = "Statistics";
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.timePeriodGroupBox.ResumeLayout(false);
this.timePeriodGroupBox.PerformLayout();
this.midsTabControl.ResumeLayout(false);
this.wr10TabPage.ResumeLayout(false);
this.wr11TabPage.ResumeLayout(false);
this.wr13TabPage.ResumeLayout(false);
this.wr14TabPage.ResumeLayout(false);
this.wr15TabPage.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TabControl midsTabControl;
private System.Windows.Forms.TabPage wr10TabPage;
private System.Windows.Forms.TabPage wr11TabPage;
private System.Windows.Forms.TabPage wr13TabPage;
private System.Windows.Forms.TabPage wr14TabPage;
private System.Windows.Forms.TabPage wr15TabPage;
private System.Windows.Forms.GroupBox timePeriodGroupBox;
private System.Windows.Forms.DateTimePicker dateTimeFromPicker;
private System.Windows.Forms.DateTimePicker dateTimeToPicker;
private System.Windows.Forms.Label toLabel1;
private System.Windows.Forms.Label fromLabel1;
private System.Windows.Forms.CheckBox timePeriodCheckBox;
private UserControls.MidOrWaterMetersCtrl wmsBenchesControl;
private UserControls.MidOrWaterMetersCtrl i1BenchesControl;
private UserControls.MidOrWaterMetersCtrl i2BbenchesControl;
private UserControls.MidOrWaterMetersCtrl i3BenchesControl;
private UserControls.MidOrWaterMetersCtrl i4BenchesControl;
}
}
+162
View File
@@ -0,0 +1,162 @@
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 NHibernate;
using FluentNHibernate;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using Results;
using Results.Entities;
using Statistics.Resources;
using Statistics.UserControls;
namespace Statistics
{
public partial class StatisticsDlg : Form
{
static string[] testBenchNames = new string[] { "WR10", "WR11", "WR13", "WR14", "WR15", "PT7" };
///
#if false
static string[] connectionStrings = new string[] {
"SERVER=10.42.128.197; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR10
"SERVER=10.42.128.98; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR11
"SERVER=10.42.128.152; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR13
"SERVER=10.42.128.143; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR14
"SERVER=10.42.128.63; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;", /// WR15
"" /// PT7
};
#else
static string[] connectionStrings = new string[] {
"SERVER=localhost; DATABASE=st-wr10-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR10
"SERVER=localhost; DATABASE=st-wr11-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR11
"SERVER=localhost; DATABASE=st-wr13-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR13
"SERVER=localhost; DATABASE=st-wr14-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR14
"SERVER=localhost; DATABASE=st-wr15-r; UID=root; PASSWORD=; CHARSET=utf8;", /// WR15
"" /// PT7
};
#endif
///
static ISessionFactory[] sessionFactories = new ISessionFactory[6];
public StatisticsDlg()
{
InitializeComponent();
ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox);
for (MidId midId = 0; midId < MidId.Count; midId++)
{
int i = (int)midId;
midsTabControl.TabPages[i].Text = midId.ToString();
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).MidId = midId;
(midsTabControl.TabPages[i].Controls[0] as MidOrWaterMetersCtrl).Parent = this;
}
midsTabControl.TabPages[0].Text = Strings.Water_meters;
Localize();
}
void Localize()
{
Text = Strings.Statistics;
timePeriodCheckBox.Text = Strings.Time_period;
fromLabel1.Text = Strings.From;
toLabel1.Text = Strings.To;
}
private void StatisticsDlg_Load(object sender, EventArgs e)
{
for (int i = 0; i < testBenchNames.Length; i++)
{
if ((i < connectionStrings.Length) && !string.IsNullOrEmpty(connectionStrings[i]))
{
sessionFactories[i] = null;
try
{
sessionFactories[i] = Fluently.Configure()
.Database(MySQLConfiguration.Standard.ConnectionString(connectionStrings[i]))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Results.Entities.Batch>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
}
catch (Exception)
{
MessageBox.Show(string.Format("Cannot open one of database of {0}", testBenchNames[i]), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
void BuildSchema(NHibernate.Cfg.Configuration config)
{
/// This NHibernate tool takes a configuration with mapping info and exports a database schema
new NHibernate.Tool.hbm2ddl.SchemaExport(config).SetOutputFile("db_schema");
}
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
{
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
if (chk.Parent == grp)
{
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
}
/// Enable or disable the GroupBox.
grp.Enabled = chk.Checked;
}
private void timePeriodCheckBox_CheckedChanged(object sender, EventArgs e)
{
ManageCheckGroupBox(timePeriodCheckBox, timePeriodGroupBox);
}
public void UpdateRequest(int benchId, MidId midId)
{
if (benchId >= sessionFactories.Length || sessionFactories[benchId] == null || (midId == MidId.WaterMeters))
{
if (midId == MidId.WaterMeters)
{
MessageBox.Show("Loading statistics of water meters is not implemented yet");
}
else
{
MessageBox.Show(string.Format("Cannot load statistics of {0}", (benchId < testBenchNames.Length) ? testBenchNames[benchId] : "XY"));
}
return;
}
try
{
ISession session = sessionFactories[benchId].OpenSession();
var listOfComponentsWithFlowmeter = session.QueryOver<Components>()
.Where(x => (x.Flowmeter == midId.ToString()))
.List();
IList<TestRslt> testRslts = new List<TestRslt>();
foreach (var cmpnts in listOfComponentsWithFlowmeter)
{
var listOfRslts = session.QueryOver<TestRslt>()
.Where(x => ((x.EndTime >= dateTimeFromPicker.Value) && (x.EndTime <= dateTimeToPicker.Value)))
.And(x => (x.Components == cmpnts))
.List();
foreach (var tr in listOfRslts) testRslts.Add(tr);
}
session.Close();
}
catch (Exception exc)
{
MessageBox.Show(string.Format("Error loading statistics of {0}\r\n{1}", (benchId < testBenchNames.Length) ? testBenchNames[benchId] : "XY", exc.Message));
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Statistics.UserControls
{
public enum MidId
{
/// When converted to 'int' it's the MID number, 0 = water meters
WaterMeters,
I1,
I2,
I3,
I4,
Count
}
}
+619
View File
@@ -0,0 +1,619 @@
namespace Statistics.UserControls
{
partial class MidOrWaterMetersCtrl
{
/// <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.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.flow3GroupBox = new System.Windows.Forms.GroupBox();
this.flow3ToExclamation = new System.Windows.Forms.Label();
this.flow3FromExclamation = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.toLabel4 = new System.Windows.Forms.Label();
this.fromLabel4 = new System.Windows.Forms.Label();
this.flow3ToTextBox = new System.Windows.Forms.TextBox();
this.flow3FromTextBox = new System.Windows.Forms.TextBox();
this.flow3CheckBox = new System.Windows.Forms.CheckBox();
this.flow2GroupBox = new System.Windows.Forms.GroupBox();
this.flow2ToExclamation = new System.Windows.Forms.Label();
this.flow2FromExclamation = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.toLabel3 = new System.Windows.Forms.Label();
this.fromLabel3 = new System.Windows.Forms.Label();
this.flow2ToTextBox = new System.Windows.Forms.TextBox();
this.flow2FromTextBox = new System.Windows.Forms.TextBox();
this.flow2CheckBox = new System.Windows.Forms.CheckBox();
this.flow1GroupBox = new System.Windows.Forms.GroupBox();
this.flow1ToExclamation = new System.Windows.Forms.Label();
this.flow1FromExclamation = new System.Windows.Forms.Label();
this.m3hLabel2 = new System.Windows.Forms.Label();
this.m3hLabel1 = new System.Windows.Forms.Label();
this.toLabel2 = new System.Windows.Forms.Label();
this.fromLabel2 = new System.Windows.Forms.Label();
this.flow1ToTextBox = new System.Windows.Forms.TextBox();
this.flow1FromTextBox = new System.Windows.Forms.TextBox();
this.flow1CheckBox = new System.Windows.Forms.CheckBox();
this.benchesTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.wr10StatisticsCtrl1 = new Statistics.UserControls.StatisticsCtrl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.wr11StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.wr13StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.wr14StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.wr15StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.pt7StatisticsCtrl = new Statistics.UserControls.StatisticsCtrl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.flow3GroupBox.SuspendLayout();
this.flow2GroupBox.SuspendLayout();
this.flow1GroupBox.SuspendLayout();
this.benchesTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.tabPage6.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.flow3GroupBox);
this.splitContainer1.Panel1.Controls.Add(this.flow2GroupBox);
this.splitContainer1.Panel1.Controls.Add(this.flow1GroupBox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.benchesTabControl);
this.splitContainer1.Size = new System.Drawing.Size(800, 450);
this.splitContainer1.SplitterDistance = 90;
this.splitContainer1.TabIndex = 0;
//
// flow3GroupBox
//
this.flow3GroupBox.Controls.Add(this.flow3ToExclamation);
this.flow3GroupBox.Controls.Add(this.flow3FromExclamation);
this.flow3GroupBox.Controls.Add(this.label3);
this.flow3GroupBox.Controls.Add(this.label4);
this.flow3GroupBox.Controls.Add(this.toLabel4);
this.flow3GroupBox.Controls.Add(this.fromLabel4);
this.flow3GroupBox.Controls.Add(this.flow3ToTextBox);
this.flow3GroupBox.Controls.Add(this.flow3FromTextBox);
this.flow3GroupBox.Controls.Add(this.flow3CheckBox);
this.flow3GroupBox.Location = new System.Drawing.Point(473, 7);
this.flow3GroupBox.Name = "flow3GroupBox";
this.flow3GroupBox.Size = new System.Drawing.Size(221, 77);
this.flow3GroupBox.TabIndex = 6;
this.flow3GroupBox.TabStop = false;
//
// flow3ToExclamation
//
this.flow3ToExclamation.AutoSize = true;
this.flow3ToExclamation.ForeColor = System.Drawing.Color.Red;
this.flow3ToExclamation.Location = new System.Drawing.Point(167, 48);
this.flow3ToExclamation.Name = "flow3ToExclamation";
this.flow3ToExclamation.Size = new System.Drawing.Size(10, 13);
this.flow3ToExclamation.TabIndex = 9;
this.flow3ToExclamation.Text = "!";
this.flow3ToExclamation.Visible = false;
//
// flow3FromExclamation
//
this.flow3FromExclamation.AutoSize = true;
this.flow3FromExclamation.ForeColor = System.Drawing.Color.Red;
this.flow3FromExclamation.Location = new System.Drawing.Point(167, 24);
this.flow3FromExclamation.Name = "flow3FromExclamation";
this.flow3FromExclamation.Size = new System.Drawing.Size(10, 13);
this.flow3FromExclamation.TabIndex = 8;
this.flow3FromExclamation.Text = "!";
this.flow3FromExclamation.Visible = false;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(178, 48);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(32, 13);
this.label3.TabIndex = 6;
this.label3.Text = "m3/h";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(177, 23);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 13);
this.label4.TabIndex = 5;
this.label4.Text = "m3/h";
//
// toLabel4
//
this.toLabel4.AutoSize = true;
this.toLabel4.Location = new System.Drawing.Point(14, 48);
this.toLabel4.Name = "toLabel4";
this.toLabel4.Size = new System.Drawing.Size(20, 13);
this.toLabel4.TabIndex = 4;
this.toLabel4.Text = "To";
//
// fromLabel4
//
this.fromLabel4.AutoSize = true;
this.fromLabel4.Location = new System.Drawing.Point(14, 23);
this.fromLabel4.Name = "fromLabel4";
this.fromLabel4.Size = new System.Drawing.Size(30, 13);
this.fromLabel4.TabIndex = 3;
this.fromLabel4.Text = "From";
//
// flow3ToTextBox
//
this.flow3ToTextBox.Location = new System.Drawing.Point(65, 45);
this.flow3ToTextBox.Name = "flow3ToTextBox";
this.flow3ToTextBox.Size = new System.Drawing.Size(100, 20);
this.flow3ToTextBox.TabIndex = 2;
this.flow3ToTextBox.TextChanged += new System.EventHandler(this.flow3ToTextBox_TextChanged);
//
// flow3FromTextBox
//
this.flow3FromTextBox.Location = new System.Drawing.Point(65, 20);
this.flow3FromTextBox.Name = "flow3FromTextBox";
this.flow3FromTextBox.Size = new System.Drawing.Size(100, 20);
this.flow3FromTextBox.TabIndex = 1;
this.flow3FromTextBox.TextChanged += new System.EventHandler(this.flow3FromTextBox_TextChanged);
//
// flow3CheckBox
//
this.flow3CheckBox.AutoSize = true;
this.flow3CheckBox.Location = new System.Drawing.Point(10, 0);
this.flow3CheckBox.Name = "flow3CheckBox";
this.flow3CheckBox.Size = new System.Drawing.Size(57, 17);
this.flow3CheckBox.TabIndex = 0;
this.flow3CheckBox.Text = "Flow 3";
this.flow3CheckBox.UseVisualStyleBackColor = true;
this.flow3CheckBox.CheckedChanged += new System.EventHandler(this.flow3CheckBox_CheckedChanged);
//
// flow2GroupBox
//
this.flow2GroupBox.Controls.Add(this.flow2ToExclamation);
this.flow2GroupBox.Controls.Add(this.flow2FromExclamation);
this.flow2GroupBox.Controls.Add(this.label1);
this.flow2GroupBox.Controls.Add(this.label2);
this.flow2GroupBox.Controls.Add(this.toLabel3);
this.flow2GroupBox.Controls.Add(this.fromLabel3);
this.flow2GroupBox.Controls.Add(this.flow2ToTextBox);
this.flow2GroupBox.Controls.Add(this.flow2FromTextBox);
this.flow2GroupBox.Controls.Add(this.flow2CheckBox);
this.flow2GroupBox.Location = new System.Drawing.Point(240, 7);
this.flow2GroupBox.Name = "flow2GroupBox";
this.flow2GroupBox.Size = new System.Drawing.Size(221, 77);
this.flow2GroupBox.TabIndex = 5;
this.flow2GroupBox.TabStop = false;
//
// flow2ToExclamation
//
this.flow2ToExclamation.AutoSize = true;
this.flow2ToExclamation.ForeColor = System.Drawing.Color.Red;
this.flow2ToExclamation.Location = new System.Drawing.Point(167, 49);
this.flow2ToExclamation.Name = "flow2ToExclamation";
this.flow2ToExclamation.Size = new System.Drawing.Size(10, 13);
this.flow2ToExclamation.TabIndex = 9;
this.flow2ToExclamation.Text = "!";
this.flow2ToExclamation.Visible = false;
//
// flow2FromExclamation
//
this.flow2FromExclamation.AutoSize = true;
this.flow2FromExclamation.ForeColor = System.Drawing.Color.Red;
this.flow2FromExclamation.Location = new System.Drawing.Point(167, 24);
this.flow2FromExclamation.Name = "flow2FromExclamation";
this.flow2FromExclamation.Size = new System.Drawing.Size(10, 13);
this.flow2FromExclamation.TabIndex = 8;
this.flow2FromExclamation.Text = "!";
this.flow2FromExclamation.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(178, 48);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 6;
this.label1.Text = "m3/h";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(177, 23);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 5;
this.label2.Text = "m3/h";
//
// toLabel3
//
this.toLabel3.AutoSize = true;
this.toLabel3.Location = new System.Drawing.Point(14, 48);
this.toLabel3.Name = "toLabel3";
this.toLabel3.Size = new System.Drawing.Size(20, 13);
this.toLabel3.TabIndex = 4;
this.toLabel3.Text = "To";
//
// fromLabel3
//
this.fromLabel3.AutoSize = true;
this.fromLabel3.Location = new System.Drawing.Point(14, 23);
this.fromLabel3.Name = "fromLabel3";
this.fromLabel3.Size = new System.Drawing.Size(30, 13);
this.fromLabel3.TabIndex = 3;
this.fromLabel3.Text = "From";
//
// flow2ToTextBox
//
this.flow2ToTextBox.Location = new System.Drawing.Point(65, 45);
this.flow2ToTextBox.Name = "flow2ToTextBox";
this.flow2ToTextBox.Size = new System.Drawing.Size(100, 20);
this.flow2ToTextBox.TabIndex = 2;
this.flow2ToTextBox.TextChanged += new System.EventHandler(this.flow2ToTextBox_TextChanged);
//
// flow2FromTextBox
//
this.flow2FromTextBox.Location = new System.Drawing.Point(65, 20);
this.flow2FromTextBox.Name = "flow2FromTextBox";
this.flow2FromTextBox.Size = new System.Drawing.Size(100, 20);
this.flow2FromTextBox.TabIndex = 1;
this.flow2FromTextBox.TextChanged += new System.EventHandler(this.flow2FromTextBox_TextChanged);
//
// flow2CheckBox
//
this.flow2CheckBox.AutoSize = true;
this.flow2CheckBox.Location = new System.Drawing.Point(6, 0);
this.flow2CheckBox.Name = "flow2CheckBox";
this.flow2CheckBox.Size = new System.Drawing.Size(57, 17);
this.flow2CheckBox.TabIndex = 0;
this.flow2CheckBox.Text = "Flow 2";
this.flow2CheckBox.UseVisualStyleBackColor = true;
this.flow2CheckBox.CheckedChanged += new System.EventHandler(this.flow2CheckBox_CheckedChanged);
//
// flow1GroupBox
//
this.flow1GroupBox.Controls.Add(this.flow1ToExclamation);
this.flow1GroupBox.Controls.Add(this.flow1FromExclamation);
this.flow1GroupBox.Controls.Add(this.m3hLabel2);
this.flow1GroupBox.Controls.Add(this.m3hLabel1);
this.flow1GroupBox.Controls.Add(this.toLabel2);
this.flow1GroupBox.Controls.Add(this.fromLabel2);
this.flow1GroupBox.Controls.Add(this.flow1ToTextBox);
this.flow1GroupBox.Controls.Add(this.flow1FromTextBox);
this.flow1GroupBox.Controls.Add(this.flow1CheckBox);
this.flow1GroupBox.Location = new System.Drawing.Point(7, 7);
this.flow1GroupBox.Name = "flow1GroupBox";
this.flow1GroupBox.Size = new System.Drawing.Size(221, 77);
this.flow1GroupBox.TabIndex = 4;
this.flow1GroupBox.TabStop = false;
//
// flow1ToExclamation
//
this.flow1ToExclamation.AutoSize = true;
this.flow1ToExclamation.ForeColor = System.Drawing.Color.Red;
this.flow1ToExclamation.Location = new System.Drawing.Point(167, 49);
this.flow1ToExclamation.Name = "flow1ToExclamation";
this.flow1ToExclamation.Size = new System.Drawing.Size(10, 13);
this.flow1ToExclamation.TabIndex = 8;
this.flow1ToExclamation.Text = "!";
this.flow1ToExclamation.Visible = false;
//
// flow1FromExclamation
//
this.flow1FromExclamation.AutoSize = true;
this.flow1FromExclamation.ForeColor = System.Drawing.Color.Red;
this.flow1FromExclamation.Location = new System.Drawing.Point(167, 24);
this.flow1FromExclamation.Name = "flow1FromExclamation";
this.flow1FromExclamation.Size = new System.Drawing.Size(10, 13);
this.flow1FromExclamation.TabIndex = 7;
this.flow1FromExclamation.Text = "!";
this.flow1FromExclamation.Visible = false;
//
// m3hLabel2
//
this.m3hLabel2.AutoSize = true;
this.m3hLabel2.Location = new System.Drawing.Point(178, 48);
this.m3hLabel2.Name = "m3hLabel2";
this.m3hLabel2.Size = new System.Drawing.Size(32, 13);
this.m3hLabel2.TabIndex = 6;
this.m3hLabel2.Text = "m3/h";
//
// m3hLabel1
//
this.m3hLabel1.AutoSize = true;
this.m3hLabel1.Location = new System.Drawing.Point(177, 23);
this.m3hLabel1.Name = "m3hLabel1";
this.m3hLabel1.Size = new System.Drawing.Size(32, 13);
this.m3hLabel1.TabIndex = 5;
this.m3hLabel1.Text = "m3/h";
//
// toLabel2
//
this.toLabel2.AutoSize = true;
this.toLabel2.Location = new System.Drawing.Point(14, 48);
this.toLabel2.Name = "toLabel2";
this.toLabel2.Size = new System.Drawing.Size(20, 13);
this.toLabel2.TabIndex = 4;
this.toLabel2.Text = "To";
//
// fromLabel2
//
this.fromLabel2.AutoSize = true;
this.fromLabel2.Location = new System.Drawing.Point(14, 23);
this.fromLabel2.Name = "fromLabel2";
this.fromLabel2.Size = new System.Drawing.Size(30, 13);
this.fromLabel2.TabIndex = 3;
this.fromLabel2.Text = "From";
//
// flow1ToTextBox
//
this.flow1ToTextBox.Location = new System.Drawing.Point(65, 45);
this.flow1ToTextBox.Name = "flow1ToTextBox";
this.flow1ToTextBox.Size = new System.Drawing.Size(100, 20);
this.flow1ToTextBox.TabIndex = 2;
this.flow1ToTextBox.TextChanged += new System.EventHandler(this.flow1ToTextBox_TextChanged);
//
// flow1FromTextBox
//
this.flow1FromTextBox.Location = new System.Drawing.Point(65, 20);
this.flow1FromTextBox.Name = "flow1FromTextBox";
this.flow1FromTextBox.Size = new System.Drawing.Size(100, 20);
this.flow1FromTextBox.TabIndex = 1;
this.flow1FromTextBox.TextChanged += new System.EventHandler(this.flow1FromTextBox_TextChanged);
//
// flow1CheckBox
//
this.flow1CheckBox.AutoSize = true;
this.flow1CheckBox.Location = new System.Drawing.Point(6, 0);
this.flow1CheckBox.Name = "flow1CheckBox";
this.flow1CheckBox.Size = new System.Drawing.Size(57, 17);
this.flow1CheckBox.TabIndex = 0;
this.flow1CheckBox.Text = "Flow 1";
this.flow1CheckBox.UseVisualStyleBackColor = true;
this.flow1CheckBox.CheckedChanged += new System.EventHandler(this.flow1CheckBox_CheckedChanged);
//
// benchesTabControl
//
this.benchesTabControl.Controls.Add(this.tabPage1);
this.benchesTabControl.Controls.Add(this.tabPage2);
this.benchesTabControl.Controls.Add(this.tabPage3);
this.benchesTabControl.Controls.Add(this.tabPage4);
this.benchesTabControl.Controls.Add(this.tabPage5);
this.benchesTabControl.Controls.Add(this.tabPage6);
this.benchesTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.benchesTabControl.Location = new System.Drawing.Point(0, 0);
this.benchesTabControl.Name = "benchesTabControl";
this.benchesTabControl.SelectedIndex = 0;
this.benchesTabControl.Size = new System.Drawing.Size(800, 356);
this.benchesTabControl.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.wr10StatisticsCtrl1);
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(792, 330);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "WR10";
this.tabPage1.UseVisualStyleBackColor = true;
//
// wr10StatisticsCtrl1
//
this.wr10StatisticsCtrl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.wr10StatisticsCtrl1.Location = new System.Drawing.Point(3, 3);
this.wr10StatisticsCtrl1.Name = "wr10StatisticsCtrl1";
this.wr10StatisticsCtrl1.Size = new System.Drawing.Size(786, 324);
this.wr10StatisticsCtrl1.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.wr11StatisticsCtrl);
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(792, 320);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "WR11";
this.tabPage2.UseVisualStyleBackColor = true;
//
// wr11StatisticsCtrl
//
this.wr11StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.wr11StatisticsCtrl.Location = new System.Drawing.Point(3, 3);
this.wr11StatisticsCtrl.Name = "wr11StatisticsCtrl";
this.wr11StatisticsCtrl.Size = new System.Drawing.Size(786, 314);
this.wr11StatisticsCtrl.TabIndex = 0;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.wr13StatisticsCtrl);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(792, 320);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "WR13";
this.tabPage3.UseVisualStyleBackColor = true;
//
// wr13StatisticsCtrl
//
this.wr13StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.wr13StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
this.wr13StatisticsCtrl.Name = "wr13StatisticsCtrl";
this.wr13StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
this.wr13StatisticsCtrl.TabIndex = 0;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.wr14StatisticsCtrl);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(792, 320);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "WR14";
this.tabPage4.UseVisualStyleBackColor = true;
//
// wr14StatisticsCtrl
//
this.wr14StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.wr14StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
this.wr14StatisticsCtrl.Name = "wr14StatisticsCtrl";
this.wr14StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
this.wr14StatisticsCtrl.TabIndex = 0;
//
// tabPage5
//
this.tabPage5.Controls.Add(this.wr15StatisticsCtrl);
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Size = new System.Drawing.Size(792, 320);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "WR15";
this.tabPage5.UseVisualStyleBackColor = true;
//
// wr15StatisticsCtrl
//
this.wr15StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.wr15StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
this.wr15StatisticsCtrl.Name = "wr15StatisticsCtrl";
this.wr15StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
this.wr15StatisticsCtrl.TabIndex = 0;
//
// tabPage6
//
this.tabPage6.Controls.Add(this.pt7StatisticsCtrl);
this.tabPage6.Location = new System.Drawing.Point(4, 22);
this.tabPage6.Name = "tabPage6";
this.tabPage6.Size = new System.Drawing.Size(792, 320);
this.tabPage6.TabIndex = 5;
this.tabPage6.Text = "PT7";
this.tabPage6.UseVisualStyleBackColor = true;
//
// pt7StatisticsCtrl
//
this.pt7StatisticsCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.pt7StatisticsCtrl.Location = new System.Drawing.Point(0, 0);
this.pt7StatisticsCtrl.Name = "pt7StatisticsCtrl";
this.pt7StatisticsCtrl.Size = new System.Drawing.Size(792, 320);
this.pt7StatisticsCtrl.TabIndex = 0;
//
// MidOrWaterMetersCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "MidOrWaterMetersCtrl";
this.Size = new System.Drawing.Size(800, 450);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.flow3GroupBox.ResumeLayout(false);
this.flow3GroupBox.PerformLayout();
this.flow2GroupBox.ResumeLayout(false);
this.flow2GroupBox.PerformLayout();
this.flow1GroupBox.ResumeLayout(false);
this.flow1GroupBox.PerformLayout();
this.benchesTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.tabPage5.ResumeLayout(false);
this.tabPage6.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TabControl benchesTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.TabPage tabPage6;
private StatisticsCtrl wr10StatisticsCtrl1;
private StatisticsCtrl wr11StatisticsCtrl;
private StatisticsCtrl wr13StatisticsCtrl;
private StatisticsCtrl wr14StatisticsCtrl;
private StatisticsCtrl wr15StatisticsCtrl;
private StatisticsCtrl pt7StatisticsCtrl;
private System.Windows.Forms.GroupBox flow3GroupBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label toLabel4;
private System.Windows.Forms.Label fromLabel4;
private System.Windows.Forms.TextBox flow3ToTextBox;
private System.Windows.Forms.TextBox flow3FromTextBox;
private System.Windows.Forms.CheckBox flow3CheckBox;
private System.Windows.Forms.GroupBox flow2GroupBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label toLabel3;
private System.Windows.Forms.Label fromLabel3;
private System.Windows.Forms.TextBox flow2ToTextBox;
private System.Windows.Forms.TextBox flow2FromTextBox;
private System.Windows.Forms.CheckBox flow2CheckBox;
private System.Windows.Forms.GroupBox flow1GroupBox;
private System.Windows.Forms.Label m3hLabel2;
private System.Windows.Forms.Label m3hLabel1;
private System.Windows.Forms.Label toLabel2;
private System.Windows.Forms.Label fromLabel2;
private System.Windows.Forms.TextBox flow1ToTextBox;
private System.Windows.Forms.TextBox flow1FromTextBox;
private System.Windows.Forms.CheckBox flow1CheckBox;
private System.Windows.Forms.Label flow1ToExclamation;
private System.Windows.Forms.Label flow1FromExclamation;
private System.Windows.Forms.Label flow3ToExclamation;
private System.Windows.Forms.Label flow3FromExclamation;
private System.Windows.Forms.Label flow2ToExclamation;
private System.Windows.Forms.Label flow2FromExclamation;
}
}
@@ -0,0 +1,171 @@
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 Statistics.Resources;
namespace Statistics.UserControls
{
public partial class MidOrWaterMetersCtrl : UserControl
{
public MidId MidId;
public StatisticsDlg Parent;
public bool Flow1Enabled { get { return flow1CheckBox.Checked; } }
public double Flow1From { get { return flow1From; } }
public double Flow1To { get { return flow1To; } }
public bool Flow2Enabled { get { return flow2CheckBox.Checked; } }
public double Flow2From { get { return flow2From; } }
public double Flow2To { get { return flow2To; } }
public bool Flow3Enabled { get { return flow3CheckBox.Checked; } }
public double Flow3From { get { return flow3From; } }
public double Flow3To { get { return flow3To; } }
/// All flows are in m3/h
double flow1From;
double flow1To;
double flow2From;
double flow2To;
double flow3From;
double flow3To;
StatisticsCtrl GetStatistics(int i)
{
if ((i >= 0) && (i < benchesTabControl.TabPages.Count) && benchesTabControl.TabPages[i].Controls.Count > 0)
{
return benchesTabControl.TabPages[i].Controls[0] as StatisticsCtrl;
}
else return null;
}
public void UpdateRequest(int benchId)
{
Parent.UpdateRequest(benchId, MidId);
}
public MidOrWaterMetersCtrl()
{
InitializeComponent();
ManageCheckGroupBox(flow1CheckBox, flow1GroupBox);
ManageCheckGroupBox(flow2CheckBox, flow2GroupBox);
ManageCheckGroupBox(flow3CheckBox, flow3GroupBox);
for (int i = 0; i < benchesTabControl.TabPages.Count; i++ )
{
TabPage tp = benchesTabControl.TabPages[i];
if ((tp.Controls.Count > 0) && (tp.Controls[0] is StatisticsCtrl))
{
(tp.Controls[0] as StatisticsCtrl).Id = i;
(tp.Controls[0] as StatisticsCtrl).BenchesCtrl = this;
}
}
}
void Localize()
{
flow1CheckBox.Text = string.Format("{0} 1", Strings.Flow);
flow2CheckBox.Text = string.Format("{0} 2", Strings.Flow);
flow3CheckBox.Text = string.Format("{0} 3", Strings.Flow);
fromLabel2.Text = Strings.From;
fromLabel3.Text = Strings.From;
fromLabel4.Text = Strings.From;
toLabel2.Text = Strings.To;
toLabel3.Text = Strings.To;
toLabel4.Text = Strings.To;
}
private void flow1CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow1CheckBox, flow1GroupBox); }
private void flow2CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow2CheckBox, flow2GroupBox); }
private void flow3CheckBox_CheckedChanged(object sender, EventArgs e) { ManageCheckGroupBox(flow3CheckBox, flow3GroupBox); }
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
{
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
if (chk.Parent == grp)
{
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
chk.Location = new Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
}
/// Enable or disable the GroupBox.
grp.Enabled = chk.Checked;
}
private void flow1FromTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(flow1FromTextBox.Text))
{
flow1From = 0;
flow1FromExclamation.Visible = false;
}
else
flow1FromExclamation.Visible = !(double.TryParse(flow1FromTextBox.Text, out flow1From) && (flow1From >= 0));
}
private void flow1ToTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(flow1ToTextBox.Text))
{
flow1To = 0;
flow1ToExclamation.Visible = false;
}
else
flow1ToExclamation.Visible = !(double.TryParse(flow1ToTextBox.Text, out flow1To) && (flow1To >= 0));
}
private void flow2FromTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(flow2FromTextBox.Text))
{
flow2From = 0;
flow2FromExclamation.Visible = false;
}
else
flow2FromExclamation.Visible = !(double.TryParse(flow2FromTextBox.Text, out flow2From) && (flow2From >= 0));
}
private void flow2ToTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(flow2ToTextBox.Text))
{
flow2To = 0;
flow2ToExclamation.Visible = false;
}
else
flow2ToExclamation.Visible = !(double.TryParse(flow2ToTextBox.Text, out flow2To) && (flow2To >= 0));
}
private void flow3FromTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(flow3FromTextBox.Text))
{
flow3From = 0;
flow3FromExclamation.Visible = false;
}
else
flow3FromExclamation.Visible = !(double.TryParse(flow3FromTextBox.Text, out flow3From) && (flow3From >= 0));
}
private void flow3ToTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(flow3ToTextBox.Text))
{
flow3To = 0;
flow3ToExclamation.Visible = false;
}
else
flow3ToExclamation.Visible = !(double.TryParse(flow3ToTextBox.Text, out flow3To) && (flow3To >= 0));
}
}
}
+60
View File
@@ -0,0 +1,60 @@
namespace Statistics.UserControls
{
partial class StatisticsCtrl
{
/// <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.updateButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// updateButton
//
this.updateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.updateButton.Location = new System.Drawing.Point(255, 11);
this.updateButton.Name = "updateButton";
this.updateButton.Size = new System.Drawing.Size(122, 43);
this.updateButton.TabIndex = 4;
this.updateButton.Text = "Update";
this.updateButton.UseVisualStyleBackColor = true;
this.updateButton.Click += new System.EventHandler(this.updateButton_Click);
//
// StatisticsCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.updateButton);
this.Name = "StatisticsCtrl";
this.Size = new System.Drawing.Size(388, 242);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button updateButton;
}
}
+27
View File
@@ -0,0 +1,27 @@
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;
namespace Statistics.UserControls
{
public partial class StatisticsCtrl : UserControl
{
public int Id; /// Index of the tab page
public MidOrWaterMetersCtrl BenchesCtrl; /// Reference to the parent control
public StatisticsCtrl()
{
InitializeComponent();
}
private void updateButton_Click(object sender, EventArgs e)
{
if (BenchesCtrl != null) BenchesCtrl.UpdateRequest(Id);
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+12
View File
@@ -46,6 +46,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TracingDB", "TracingDB\Trac
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GemCard", "GemCard\GemCard.csproj", "{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Statistics", "Statistics\Statistics.csproj", "{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -174,6 +176,16 @@ Global
{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}.Release|Mixed Platforms.Build.0 = Release|x86
{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}.Release|x86.ActiveCfg = Release|x86
{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}.Release|x86.Build.0 = Release|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|Any CPU.ActiveCfg = Debug|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|Mixed Platforms.Build.0 = Debug|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|x86.ActiveCfg = Debug|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Debug|x86.Build.0 = Debug|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|Any CPU.ActiveCfg = Release|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|Mixed Platforms.ActiveCfg = Release|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|Mixed Platforms.Build.0 = Release|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|x86.ActiveCfg = Release|x86
{36755E1D-6FC3-4D9C-8DD3-0250D51532E0}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -29,6 +29,9 @@ namespace TBF.BenchControl.BenchInfo.Munich
public string Address4 { get { return string.Empty; } }
public string Address5 { get { return string.Empty; } }
public RemoteDBUse RemoteDBUse { get { return RemoteDBUse.LocalDBOnly; } }
#if ORACLE_DB
public int MaxTestIndex { get { return 0; } }
#endif
public Component()
{
@@ -0,0 +1,46 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.iPerl
{
/// <summary>
/// Holds information identifying the test bench.
/// </summary>
public class Component : ComponentBase, GenericDevices.IBenchInfo
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("BenchInfo.iPerl({0})", Cfg.ToString(1)); }
readonly ComponentCfg myCfg;
public string TestBenchName { get { return myCfg.TestBenchName; } }
public int TestBenchId { get { return myCfg.TestBenchId; } }
public string Address1 { get { return myCfg.Address1; } }
public string Address2 { get { return myCfg.Address2; } }
public string Address3 { get { return myCfg.Address3; } }
public string Address4 { get { return myCfg.Address4; } }
public string Address5 { get { return myCfg.Address5; } }
public RemoteDBUse RemoteDBUse { get { return myCfg.RemoteDBUse; } }
public Side Side { get { return myCfg.Side; } }
public int MaxTestIndex { get { return myCfg.MaxTestIndex; } } /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as ComponentCfg;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,266 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.BenchInfo.iPerl
{
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
public string TestBenchName;
public int TestBenchId;
public string Address1;
public string Address2;
public string Address3;
public string Address4;
public string Address5;
public string ApprovalId;
public string ApprovalDate;
public string ApprovedBy;
public RemoteDBUse RemoteDBUse;
public Side Side;
public int MaxTestIndex; /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg() {}
public ComponentCfg(string name, IComponentFactory factory)
: this()
{
Factory = factory;
Name = name;
ParentName = string.Empty;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
TestBenchName = "1";
TestBenchId = 1;
Address1 = string.Empty;
Address2 = string.Empty;
Address3 = string.Empty;
Address4 = string.Empty;
Address5 = string.Empty;
ApprovalId = string.Empty;
ApprovalDate = string.Empty;
ApprovedBy = string.Empty;
RemoteDBUse = RemoteDBUse.LocalDBOnly;
Side = Side.Left;
MaxTestIndex = 4;
}
string[] paramNames = new string[]
{
"Test bench name",
"Test bench ID",
"Address 1",
"Address 2",
"Address 3",
"Address 4",
"Address 5",
"Approval",
"Approval date",
"Approved by",
"Remote DB use",
Strings.Side,
"Max.test index",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i)
{
if (i == 10)
{
IList<string> list = new List<string>();
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++) list.Add(rdbu.ToDescription());
return list;
}
else if (i == 11)
{
IList<string> list = new List<string>();
for (Side side = 0; side < Side.Count; side++) list.Add(side.ToDescription());
return list;
}
else
{
return null;
}
}
public string ToString(int i)
{
if (i == -1)
{
return string.Format("{0}: Bench name={1}, Bench Id={2}, Procedures={3}", Name, TestBenchName, TestBenchId, RemoteDBUse.ToDescription());
}
switch (i)
{
case 0: return TestBenchName;
case 1: return TestBenchId.ToString();
case 2: return Address1;
case 3: return Address2;
case 4: return Address3;
case 5: return Address4;
case 6: return Address5;
case 7: return ApprovalId;
case 8: return ApprovalDate;
case 9: return ApprovedBy;
case 10: return RemoteDBUse.ToDescription();
case 11: return Side.ToDescription();
case 12: return MaxTestIndex.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: TestBenchName = strValue; return CfgUpdateFlags.RestartRqrd;
case 1: TestBenchId = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
case 2: Address1 = strValue; return CfgUpdateFlags.RestartRqrd;
case 3: Address2 = strValue; return CfgUpdateFlags.RestartRqrd;
case 4: Address3 = strValue; return CfgUpdateFlags.RestartRqrd;
case 5: Address4 = strValue; return CfgUpdateFlags.RestartRqrd;
case 6: Address5 = strValue; return CfgUpdateFlags.RestartRqrd;
case 7: ApprovalId = strValue; return CfgUpdateFlags.RestartRqrd;
case 8: ApprovalDate = strValue; return CfgUpdateFlags.RestartRqrd;
case 9: ApprovedBy = strValue; return CfgUpdateFlags.RestartRqrd;
case 10:
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
{
if (strValue == rdbu.ToDescription())
{
if (RemoteDBUse != rdbu)
{
RemoteDBUse = rdbu;
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
}
}
return CfgUpdateFlags.Error;
case 11:
for (Side side = 0; side < Side.Count; side++)
{
if (strValue == side.ToDescription())
{
if (Side != side)
{
Side = side;
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
}
}
return CfgUpdateFlags.Error;
case 12: MaxTestIndex = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int idummy;
switch (i)
{
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
return true;
case 1:
case 12:
if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
break;
case 10:
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
{
if (strValue == rdbu.ToDescription()) return true;
}
return false;
case 11:
for (Side side = 0; side < Side.Count; side++)
{
if (strValue == side.ToDescription()) return true;
}
return false;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(ComponentCfg prms)
{
prms.TestBenchName = this.TestBenchName;
prms.TestBenchId = this.TestBenchId;
prms.Address1 = this.Address1;
prms.Address2 = this.Address2;
prms.Address3 = this.Address3;
prms.Address4 = this.Address4;
prms.Address5 = this.Address5;
prms.ApprovalId = this.ApprovalId;
prms.ApprovalDate = this.ApprovalDate;
prms.ApprovedBy = this.ApprovedBy;
prms.RemoteDBUse = this.RemoteDBUse;
prms.Side = this.Side;
prms.MaxTestIndex = this.MaxTestIndex;
}
public Config.Entities.IParamsProvider Clone()
{
ComponentCfg pars = new ComponentCfg();
CopyContentTo(pars);
return pars;
}
public void UpdateEmbeddedDbEntity()
{
/// Do nothing
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchInfo.iPerl
{
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return "BenchInfo.iPerl"; } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new ComponentCfg("BenchInfo.iPerl", this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(ComponentCfg.Serializer, component, this);
}
}
}
@@ -188,6 +188,12 @@ namespace TBF.BenchControl.Configs.ParamsProvider
{
flags |= paramsProvider.UpdateParam(itemNr, e.DisplayText);
}
else
{
MessageBox.Show(message);
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
}
}
}
}
@@ -36,6 +36,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
double refVolume;
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
bool fixedErrorLimits; /// false in case of calculated error limits
int TextBoxesCount;
///
@@ -119,6 +120,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
this.refVolume = refVolume;
this.warningLimLo = 2 * errLimLo;
this.warningLimHi = 2 * errLimHi;
this.fixedErrorLimits = (errLimHi > errLimLo);
ShuffleTextBoxes();
@@ -286,7 +288,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { };
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation1.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox2_TextChanged(object sender, EventArgs e)
{
@@ -298,7 +300,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation2.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox3_TextChanged(object sender, EventArgs e)
{
@@ -310,7 +312,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation3.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox4_TextChanged(object sender, EventArgs e)
{
@@ -322,7 +324,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation4.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox5_TextChanged(object sender, EventArgs e)
{
@@ -334,7 +336,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation5.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox6_TextChanged(object sender, EventArgs e)
{
@@ -346,7 +348,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation6.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox7_TextChanged(object sender, EventArgs e)
{
@@ -358,7 +360,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation7.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox8_TextChanged(object sender, EventArgs e)
{
@@ -370,7 +372,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation8.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox9_TextChanged(object sender, EventArgs e)
{
@@ -382,7 +384,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation9.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox10_TextChanged(object sender, EventArgs e)
@@ -395,7 +397,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation10.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox11_TextChanged(object sender, EventArgs e)
@@ -408,7 +410,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation11.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox12_TextChanged(object sender, EventArgs e)
{
@@ -420,7 +422,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation12.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
/// <summary>
@@ -36,6 +36,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
double refVolume;
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
bool fixedErrorLimits; /// false in case of calculated error limits
int TextBoxesCount;
///
@@ -124,6 +125,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
this.refVolume = refVolume;
this.warningLimLo = 2 * errLimLo;
this.warningLimHi = 2 * errLimHi;
this.fixedErrorLimits = (errLimHi > errLimLo);
ShuffleTextBoxes();
@@ -289,7 +291,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { };
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation1.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox2_TextChanged(object sender, EventArgs e)
{
@@ -301,7 +303,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation2.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox3_TextChanged(object sender, EventArgs e)
{
@@ -313,7 +315,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation3.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox4_TextChanged(object sender, EventArgs e)
{
@@ -325,7 +327,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation4.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox5_TextChanged(object sender, EventArgs e)
{
@@ -337,7 +339,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation5.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox6_TextChanged(object sender, EventArgs e)
{
@@ -349,7 +351,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation6.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox7_TextChanged(object sender, EventArgs e)
{
@@ -361,7 +363,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation7.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox8_TextChanged(object sender, EventArgs e)
{
@@ -373,7 +375,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation8.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox9_TextChanged(object sender, EventArgs e)
{
@@ -385,7 +387,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation9.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox10_TextChanged(object sender, EventArgs e)
@@ -398,7 +400,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation10.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox11_TextChanged(object sender, EventArgs e)
@@ -411,7 +413,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation11.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox12_TextChanged(object sender, EventArgs e)
{
@@ -423,7 +425,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation12.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox13_TextChanged(object sender, EventArgs e)
{
@@ -435,7 +437,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation13.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox14_TextChanged(object sender, EventArgs e)
{
@@ -447,7 +449,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation14.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox15_TextChanged(object sender, EventArgs e)
{
@@ -459,7 +461,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation15.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox16_TextChanged(object sender, EventArgs e)
{
@@ -471,7 +473,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation16.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox17_TextChanged(object sender, EventArgs e)
{
@@ -483,7 +485,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation17.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox18_TextChanged(object sender, EventArgs e)
{
@@ -495,7 +497,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation18.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox19_TextChanged(object sender, EventArgs e)
{
@@ -507,7 +509,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation19.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox20_TextChanged(object sender, EventArgs e)
{
@@ -519,7 +521,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation20.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox21_TextChanged(object sender, EventArgs e)
{
@@ -531,7 +533,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation21.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox22_TextChanged(object sender, EventArgs e)
{
@@ -543,7 +545,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation22.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox23_TextChanged(object sender, EventArgs e)
{
@@ -555,7 +557,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation23.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox24_TextChanged(object sender, EventArgs e)
{
@@ -567,7 +569,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation24.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
/// <summary>
@@ -36,6 +36,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
double refVolume;
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
bool fixedErrorLimits; /// false in case of calculated error limits
int TextBoxesCount;
///
@@ -128,6 +129,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
this.refVolume = refVolume;
this.warningLimLo = 2 * errLimLo;
this.warningLimHi = 2 * errLimHi;
this.fixedErrorLimits = (errLimHi > errLimLo);
ShuffleTextBoxes();
@@ -294,7 +296,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void endTextBox1_TextChanged(object sndr, EventArgs e) { ProcTextChanged(sndr, e, endTextBox1, startTextBox1, exclamation1); }
@@ -31,328 +31,303 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.comboBox3 = new System.Windows.Forms.ComboBox();
this.checkBox7 = new System.Windows.Forms.CheckBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.comboBox4 = new System.Windows.Forms.ComboBox();
this.checkBox4 = new System.Windows.Forms.CheckBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.comboBox5 = new System.Windows.Forms.ComboBox();
this.checkBox5 = new System.Windows.Forms.CheckBox();
this.label5 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.comboBox6 = new System.Windows.Forms.ComboBox();
this.checkBox6 = new System.Windows.Forms.CheckBox();
this.label6 = new System.Windows.Forms.Label();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.clearButton = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.orderGroupBox.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.comboBox1);
this.groupBox1.Controls.Add(this.checkBox1);
this.groupBox1.Controls.Add(this.label1);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.ForeColor = System.Drawing.Color.Black;
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
resources.ApplyResources(this.comboBox1, "comboBox1");
this.comboBox1.Name = "comboBox1";
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
this.comboBox1.TextChanged += new System.EventHandler(this.comboBox1_TextChanged);
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress);
//
// checkBox1
//
resources.ApplyResources(this.checkBox1, "checkBox1");
this.checkBox1.Name = "checkBox1";
this.checkBox1.UseVisualStyleBackColor = true;
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.comboBox2);
this.groupBox2.Controls.Add(this.checkBox2);
this.groupBox2.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.ForeColor = System.Drawing.Color.Black;
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// comboBox2
//
this.comboBox2.FormattingEnabled = true;
resources.ApplyResources(this.comboBox2, "comboBox2");
this.comboBox2.Name = "comboBox2";
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
this.comboBox2.TextChanged += new System.EventHandler(this.comboBox2_TextChanged);
this.comboBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox2_KeyPress);
//
// checkBox2
//
resources.ApplyResources(this.checkBox2, "checkBox2");
this.checkBox2.Name = "checkBox2";
this.checkBox2.UseVisualStyleBackColor = true;
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.comboBox3);
this.groupBox3.Controls.Add(this.checkBox7);
this.groupBox3.Controls.Add(this.checkBox3);
this.groupBox3.Controls.Add(this.label3);
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.ForeColor = System.Drawing.Color.Black;
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// comboBox3
//
this.comboBox3.FormattingEnabled = true;
resources.ApplyResources(this.comboBox3, "comboBox3");
this.comboBox3.Name = "comboBox3";
this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged);
this.comboBox3.TextChanged += new System.EventHandler(this.comboBox3_TextChanged);
this.comboBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox3_KeyPress);
//
// checkBox7
//
resources.ApplyResources(this.checkBox7, "checkBox7");
this.checkBox7.Name = "checkBox7";
this.checkBox7.UseVisualStyleBackColor = true;
//
// checkBox3
//
resources.ApplyResources(this.checkBox3, "checkBox3");
this.checkBox3.Name = "checkBox3";
this.checkBox3.UseVisualStyleBackColor = true;
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.comboBox4);
this.groupBox4.Controls.Add(this.checkBox4);
this.groupBox4.Controls.Add(this.label4);
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.ForeColor = System.Drawing.Color.Black;
this.groupBox4.Name = "groupBox4";
this.groupBox4.TabStop = false;
//
// comboBox4
//
this.comboBox4.FormattingEnabled = true;
resources.ApplyResources(this.comboBox4, "comboBox4");
this.comboBox4.Name = "comboBox4";
this.comboBox4.SelectedIndexChanged += new System.EventHandler(this.comboBox4_SelectedIndexChanged);
this.comboBox4.TextChanged += new System.EventHandler(this.comboBox4_TextChanged);
this.comboBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox4_KeyPress);
//
// checkBox4
//
resources.ApplyResources(this.checkBox4, "checkBox4");
this.checkBox4.Name = "checkBox4";
this.checkBox4.UseVisualStyleBackColor = true;
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.comboBox5);
this.groupBox5.Controls.Add(this.checkBox5);
this.groupBox5.Controls.Add(this.label5);
resources.ApplyResources(this.groupBox5, "groupBox5");
this.groupBox5.ForeColor = System.Drawing.Color.Black;
this.groupBox5.Name = "groupBox5";
this.groupBox5.TabStop = false;
//
// comboBox5
//
this.comboBox5.FormattingEnabled = true;
resources.ApplyResources(this.comboBox5, "comboBox5");
this.comboBox5.Name = "comboBox5";
this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged);
this.comboBox5.TextChanged += new System.EventHandler(this.comboBox5_TextChanged);
this.comboBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox5_KeyPress);
//
// checkBox5
//
resources.ApplyResources(this.checkBox5, "checkBox5");
this.checkBox5.Name = "checkBox5";
this.checkBox5.UseVisualStyleBackColor = true;
//
// label5
//
resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.comboBox6);
this.groupBox6.Controls.Add(this.checkBox6);
this.groupBox6.Controls.Add(this.label6);
resources.ApplyResources(this.groupBox6, "groupBox6");
this.groupBox6.ForeColor = System.Drawing.Color.Black;
this.groupBox6.Name = "groupBox6";
this.groupBox6.TabStop = false;
//
// comboBox6
//
this.comboBox6.FormattingEnabled = true;
resources.ApplyResources(this.comboBox6, "comboBox6");
this.comboBox6.Name = "comboBox6";
this.comboBox6.SelectedIndexChanged += new System.EventHandler(this.comboBox6_SelectedIndexChanged);
this.comboBox6.TextChanged += new System.EventHandler(this.comboBox6_TextChanged);
this.comboBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox6_KeyPress);
//
// checkBox6
//
resources.ApplyResources(this.checkBox6, "checkBox6");
this.checkBox6.Name = "checkBox6";
this.checkBox6.UseVisualStyleBackColor = true;
//
// label6
//
resources.ApplyResources(this.label6, "label6");
this.label6.Name = "label6";
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.TabStop = false;
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.Name = "orderComboBox";
//
// clearButton
//
resources.ApplyResources(this.clearButton, "clearButton");
this.clearButton.ForeColor = System.Drawing.Color.Black;
this.clearButton.Name = "clearButton";
this.clearButton.UseVisualStyleBackColor = true;
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.clearButton);
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.groupBox6);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.orderGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.clearButton = new System.Windows.Forms.Button();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.comboBox3 = new System.Windows.Forms.ComboBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.comboBox4 = new System.Windows.Forms.ComboBox();
this.checkBox4 = new System.Windows.Forms.CheckBox();
this.label4 = new System.Windows.Forms.Label();
this.comboBox5 = new System.Windows.Forms.ComboBox();
this.checkBox5 = new System.Windows.Forms.CheckBox();
this.label5 = new System.Windows.Forms.Label();
this.comboBox6 = new System.Windows.Forms.ComboBox();
this.checkBox6 = new System.Windows.Forms.CheckBox();
this.label6 = new System.Windows.Forms.Label();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.orderLabel = new System.Windows.Forms.Label();
this.snLabel = new System.Windows.Forms.Label();
this.remarkLabel = new System.Windows.Forms.Label();
this.remarkComboBox6 = new System.Windows.Forms.ComboBox();
this.remarkComboBox1 = new System.Windows.Forms.ComboBox();
this.remarkComboBox2 = new System.Windows.Forms.ComboBox();
this.remarkComboBox3 = new System.Windows.Forms.ComboBox();
this.remarkComboBox4 = new System.Windows.Forms.ComboBox();
this.remarkComboBox5 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// comboBox1
//
resources.ApplyResources(this.comboBox1, "comboBox1");
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Name = "comboBox1";
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
this.comboBox1.TextChanged += new System.EventHandler(this.comboBox1_TextChanged);
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress);
//
// checkBox1
//
resources.ApplyResources(this.checkBox1, "checkBox1");
this.checkBox1.Name = "checkBox1";
this.checkBox1.UseVisualStyleBackColor = true;
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// clearButton
//
resources.ApplyResources(this.clearButton, "clearButton");
this.clearButton.ForeColor = System.Drawing.Color.Black;
this.clearButton.Name = "clearButton";
this.clearButton.UseVisualStyleBackColor = true;
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
//
// comboBox2
//
resources.ApplyResources(this.comboBox2, "comboBox2");
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Name = "comboBox2";
this.comboBox2.TextChanged += new System.EventHandler(this.comboBox2_TextChanged);
this.comboBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox2_KeyPress);
//
// checkBox2
//
resources.ApplyResources(this.checkBox2, "checkBox2");
this.checkBox2.Name = "checkBox2";
this.checkBox2.UseVisualStyleBackColor = true;
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// comboBox3
//
resources.ApplyResources(this.comboBox3, "comboBox3");
this.comboBox3.FormattingEnabled = true;
this.comboBox3.Name = "comboBox3";
this.comboBox3.TextChanged += new System.EventHandler(this.comboBox3_TextChanged);
this.comboBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox3_KeyPress);
//
// checkBox3
//
resources.ApplyResources(this.checkBox3, "checkBox3");
this.checkBox3.Name = "checkBox3";
this.checkBox3.UseVisualStyleBackColor = true;
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// comboBox4
//
resources.ApplyResources(this.comboBox4, "comboBox4");
this.comboBox4.FormattingEnabled = true;
this.comboBox4.Name = "comboBox4";
this.comboBox4.TextChanged += new System.EventHandler(this.comboBox4_TextChanged);
this.comboBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox4_KeyPress);
//
// checkBox4
//
resources.ApplyResources(this.checkBox4, "checkBox4");
this.checkBox4.Name = "checkBox4";
this.checkBox4.UseVisualStyleBackColor = true;
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// comboBox5
//
resources.ApplyResources(this.comboBox5, "comboBox5");
this.comboBox5.FormattingEnabled = true;
this.comboBox5.Name = "comboBox5";
this.comboBox5.TextChanged += new System.EventHandler(this.comboBox5_TextChanged);
this.comboBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox5_KeyPress);
//
// checkBox5
//
resources.ApplyResources(this.checkBox5, "checkBox5");
this.checkBox5.Name = "checkBox5";
this.checkBox5.UseVisualStyleBackColor = true;
//
// label5
//
resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5";
//
// comboBox6
//
resources.ApplyResources(this.comboBox6, "comboBox6");
this.comboBox6.FormattingEnabled = true;
this.comboBox6.Name = "comboBox6";
this.comboBox6.TextChanged += new System.EventHandler(this.comboBox6_TextChanged);
this.comboBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox6_KeyPress);
//
// checkBox6
//
resources.ApplyResources(this.checkBox6, "checkBox6");
this.checkBox6.Name = "checkBox6";
this.checkBox6.UseVisualStyleBackColor = true;
//
// label6
//
resources.ApplyResources(this.label6, "label6");
this.label6.Name = "label6";
//
// orderComboBox
//
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.FormattingEnabled = true;
this.orderComboBox.Name = "orderComboBox";
//
// orderLabel
//
resources.ApplyResources(this.orderLabel, "orderLabel");
this.orderLabel.Name = "orderLabel";
//
// snLabel
//
resources.ApplyResources(this.snLabel, "snLabel");
this.snLabel.Name = "snLabel";
//
// remarkLabel
//
resources.ApplyResources(this.remarkLabel, "remarkLabel");
this.remarkLabel.Name = "remarkLabel";
//
// remarkComboBox6
//
resources.ApplyResources(this.remarkComboBox6, "remarkComboBox6");
this.remarkComboBox6.FormattingEnabled = true;
this.remarkComboBox6.Name = "remarkComboBox6";
//
// remarkComboBox1
//
resources.ApplyResources(this.remarkComboBox1, "remarkComboBox1");
this.remarkComboBox1.FormattingEnabled = true;
this.remarkComboBox1.Name = "remarkComboBox1";
//
// remarkComboBox2
//
resources.ApplyResources(this.remarkComboBox2, "remarkComboBox2");
this.remarkComboBox2.FormattingEnabled = true;
this.remarkComboBox2.Name = "remarkComboBox2";
//
// remarkComboBox3
//
resources.ApplyResources(this.remarkComboBox3, "remarkComboBox3");
this.remarkComboBox3.FormattingEnabled = true;
this.remarkComboBox3.Name = "remarkComboBox3";
//
// remarkComboBox4
//
resources.ApplyResources(this.remarkComboBox4, "remarkComboBox4");
this.remarkComboBox4.FormattingEnabled = true;
this.remarkComboBox4.Name = "remarkComboBox4";
//
// remarkComboBox5
//
resources.ApplyResources(this.remarkComboBox5, "remarkComboBox5");
this.remarkComboBox5.FormattingEnabled = true;
this.remarkComboBox5.Name = "remarkComboBox5";
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.remarkComboBox5);
this.Controls.Add(this.remarkComboBox4);
this.Controls.Add(this.remarkComboBox3);
this.Controls.Add(this.remarkComboBox2);
this.Controls.Add(this.remarkComboBox1);
this.Controls.Add(this.remarkComboBox6);
this.Controls.Add(this.remarkLabel);
this.Controls.Add(this.snLabel);
this.Controls.Add(this.orderLabel);
this.Controls.Add(this.orderComboBox);
this.Controls.Add(this.comboBox6);
this.Controls.Add(this.checkBox6);
this.Controls.Add(this.label6);
this.Controls.Add(this.comboBox5);
this.Controls.Add(this.checkBox5);
this.Controls.Add(this.label5);
this.Controls.Add(this.comboBox4);
this.Controls.Add(this.checkBox4);
this.Controls.Add(this.label4);
this.Controls.Add(this.comboBox3);
this.Controls.Add(this.checkBox3);
this.Controls.Add(this.label3);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.checkBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.clearButton);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.CheckBox checkBox7;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.CheckBox checkBox4;
private System.Windows.Forms.CheckBox checkBox5;
private System.Windows.Forms.CheckBox checkBox6;
private System.Windows.Forms.GroupBox orderGroupBox;
private System.Windows.Forms.ComboBox orderComboBox;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.ComboBox comboBox4;
private System.Windows.Forms.ComboBox comboBox5;
private System.Windows.Forms.ComboBox comboBox6;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button clearButton;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox comboBox4;
private System.Windows.Forms.CheckBox checkBox4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox comboBox5;
private System.Windows.Forms.CheckBox checkBox5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox comboBox6;
private System.Windows.Forms.CheckBox checkBox6;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox orderComboBox;
private System.Windows.Forms.Label orderLabel;
private System.Windows.Forms.Label snLabel;
private System.Windows.Forms.Label remarkLabel;
private System.Windows.Forms.ComboBox remarkComboBox6;
private System.Windows.Forms.ComboBox remarkComboBox1;
private System.Windows.Forms.ComboBox remarkComboBox2;
private System.Windows.Forms.ComboBox remarkComboBox3;
private System.Windows.Forms.ComboBox remarkComboBox4;
private System.Windows.Forms.ComboBox remarkComboBox5;
}
}
@@ -15,11 +15,13 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// <summary> Number of text boxes for serial numbers </summary>
public readonly int WaterMetersCount;
public readonly bool RemarksEnabled;
/// To be retrieved after the form is closed
public string PurchaseOrder;
public string[] SNText;
public bool[] Disabled;
public string[] Remark;
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
@@ -27,21 +29,29 @@ namespace TBF.BenchControl.DataEntry.Standard6
IList<ComboBox> enabledComboBoxes;
ComboBox[] comboBoxes;
CheckBox[] checkBoxes;
ComboBox[] remarkBoxes;
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
public CycleBeginningForm(int waterMetersCount, bool remarksEnabled)
{
InitializeComponent();
ControlBox = false;
comboBoxes = new ComboBox[] { comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6 };
checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6 };
remarkBoxes = new ComboBox[] { remarkComboBox1, remarkComboBox2, remarkComboBox3, remarkComboBox4, remarkComboBox5, remarkComboBox6 };
this.WaterMetersCount = waterMetersCount;
this.RemarksEnabled = remarksEnabled;
SNText = new string[WaterMetersCount];
Disabled = new bool[WaterMetersCount];
enabledComboBoxes = new List<ComboBox>();
Height = 147 + WaterMetersCount * 90;
Remark = new string[WaterMetersCount];
enabledComboBoxes = new List<ComboBox>();
completed = false;
StartForceCloseHandler();
@@ -49,15 +59,20 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// <summary> Parameterless constructor for all watermeters </summary>
public CycleBeginningForm()
: this(Config.Data.WMsCount)
: this(Config.Data.WMsCount, false)
{
}
private void CycleBeginningForm_Load(object sender, EventArgs e)
{
Localize();
PrepareOrderCombo(orderComboBox);
PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory);
for (int i = 0; i < WaterMetersCount; i++)
{
PrepareCombo(remarkBoxes[i], Program.LocalSettings.RemarkHistory, true);
}
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
{
@@ -69,53 +84,65 @@ namespace TBF.BenchControl.DataEntry.Standard6
if (WaterMetersCount >= 6) comboBox6.Items.Add((Program.LocalSettings.LastSNTexts[5] == null) ? string.Empty : Program.LocalSettings.LastSNTexts[5]);
}
if (WaterMetersCount < 1) { groupBox1.Visible = false; } else { enabledComboBoxes.Add(comboBox1); }
if (WaterMetersCount < 2) { groupBox2.Visible = false; } else { enabledComboBoxes.Add(comboBox2); }
if (WaterMetersCount < 3) { groupBox3.Visible = false; } else { enabledComboBoxes.Add(comboBox3); }
if (WaterMetersCount < 4) { groupBox4.Visible = false; } else { enabledComboBoxes.Add(comboBox4); }
if (WaterMetersCount < 5) { groupBox5.Visible = false; } else { enabledComboBoxes.Add(comboBox5); }
if (WaterMetersCount < 6) { groupBox6.Visible = false; } else { enabledComboBoxes.Add(comboBox6); }
if (WaterMetersCount >= 1) { enabledComboBoxes.Add(comboBox1); } else { comboBox1.Visible = false; label1.Visible = false; checkBox1.Visible = false; }
if (WaterMetersCount >= 2) { enabledComboBoxes.Add(comboBox2); } else { comboBox2.Visible = false; label2.Visible = false; checkBox2.Visible = false; }
if (WaterMetersCount >= 3) { enabledComboBoxes.Add(comboBox3); } else { comboBox3.Visible = false; label3.Visible = false; checkBox3.Visible = false; }
if (WaterMetersCount >= 4) { enabledComboBoxes.Add(comboBox4); } else { comboBox4.Visible = false; label4.Visible = false; checkBox4.Visible = false; }
if (WaterMetersCount >= 5) { enabledComboBoxes.Add(comboBox5); } else { comboBox5.Visible = false; label5.Visible = false; checkBox5.Visible = false; }
if (WaterMetersCount >= 6) { enabledComboBoxes.Add(comboBox6); } else { comboBox6.Visible = false; label6.Visible = false; checkBox6.Visible = false; }
Height = 147 + WaterMetersCount * 90;
}
if (RemarksEnabled)
{
if (WaterMetersCount >= 1) { remarkComboBox1.Visible = true; remarkLabel.Visible = true; }
if (WaterMetersCount >= 2) { remarkComboBox2.Visible = true; }
if (WaterMetersCount >= 3) { remarkComboBox3.Visible = true; }
if (WaterMetersCount >= 4) { remarkComboBox4.Visible = true; }
if (WaterMetersCount >= 5) { remarkComboBox5.Visible = true; }
if (WaterMetersCount >= 6) { remarkComboBox6.Visible = true; }
}
Height = 177 + WaterMetersCount * 46;
if (!RemarksEnabled) Width -= remarkComboBox1.Width;
//Size = new System.Drawing.Size(RemarksEnabled ? 1045 : 624, 177 + WaterMetersCount * 46);
}
void Localize()
{
Text = Strings.Data;
orderGroupBox.Text = Strings.Purchase_order;
orderLabel.Text = Strings.Purchase_order;
snLabel.Text = Strings.Serial_Number;
remarkLabel.Text = Strings.Remark;
okButton.Text = Strings.OkBtnText;
clearButton.Text = Strings.ClearBtnText;
groupBox1.Text = Strings.Water_Meter + " 1";
groupBox2.Text = Strings.Water_Meter + " 2";
groupBox3.Text = Strings.Water_Meter + " 3";
groupBox4.Text = Strings.Water_Meter + " 4";
groupBox5.Text = Strings.Water_Meter + " 5";
groupBox6.Text = Strings.Water_Meter + " 6";
label1.Text = Strings.Serial_Number;
label2.Text = Strings.Serial_Number;
label3.Text = Strings.Serial_Number;
label4.Text = Strings.Serial_Number;
label5.Text = Strings.Serial_Number;
label6.Text = Strings.Serial_Number;
okButton.Text = Strings.OkBtnText;
clearButton.Text = Strings.ClearBtnText;
label1.Text = Strings.Water_Meter + " 1";
label2.Text = Strings.Water_Meter + " 2";
label3.Text = Strings.Water_Meter + " 3";
label4.Text = Strings.Water_Meter + " 4";
label5.Text = Strings.Water_Meter + " 5";
label6.Text = Strings.Water_Meter + " 6";
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareOrderCombo(ComboBox orderComboBox)
/// <param name="comboBox">Puchase order ComboBox</param>
void PrepareCombo(ComboBox comboBox, string[] history, bool emptyOnStart = false)
{
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
int historyLen = (history != null) ? history.Length : 0;
if (!emptyOnStart && (historyLen > 0))
{
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
comboBox.Text = history[0];
}
else
{
comboBox.Text = string.Empty;
}
if (orderComboBox.Items.Count > 0)
for (int i = 0; i < historyLen; i++)
{
orderComboBox.Text = orderComboBox.Items[0].ToString();
comboBox.Items.Add(history[i]);
}
}
@@ -129,14 +156,15 @@ namespace TBF.BenchControl.DataEntry.Standard6
#endif
);
Program.LocalSettings.LastSNTexts = SNText;
Program.LocalSettings.LastSNTexts = SNText;
if (WaterMetersCount >= 1) { SNText[0] = comboBox1.Text; Disabled[0] = !checkBox1.Checked; }
if (WaterMetersCount >= 2) { SNText[1] = comboBox2.Text; Disabled[1] = !checkBox2.Checked; }
if (WaterMetersCount >= 3) { SNText[2] = comboBox3.Text; Disabled[2] = !checkBox3.Checked; }
if (WaterMetersCount >= 4) { SNText[3] = comboBox4.Text; Disabled[3] = !checkBox4.Checked; }
if (WaterMetersCount >= 5) { SNText[4] = comboBox5.Text; Disabled[4] = !checkBox5.Checked; }
if (WaterMetersCount >= 6) { SNText[5] = comboBox6.Text; Disabled[5] = !checkBox6.Checked; }
for (int i = 0; i < WaterMetersCount; i++)
{
Program.LocalSettings.UpdateHistory(remarkBoxes[i].Text, ref Program.LocalSettings.RemarkHistory, 20);
SNText[i] = comboBoxes[i].Text;
Disabled[i] = !checkBoxes[i].Checked;
Remark[i] = remarkBoxes[i].Text;
}
completed = true;
Close();
@@ -145,36 +173,11 @@ namespace TBF.BenchControl.DataEntry.Standard6
private void UpdateAllCombos()
{
if (WaterMetersCount >= 1)
{
comboBox1.Text = Program.LocalSettings.LastSNTexts[0];
checkBox1.Checked = !string.IsNullOrEmpty(comboBox1.Text);
}
if (WaterMetersCount >= 2)
{
comboBox2.Text = Program.LocalSettings.LastSNTexts[1];
checkBox2.Checked = !string.IsNullOrEmpty(comboBox2.Text);
}
if (WaterMetersCount >= 3)
{
comboBox3.Text = Program.LocalSettings.LastSNTexts[2];
checkBox3.Checked = !string.IsNullOrEmpty(comboBox3.Text);
}
if (WaterMetersCount >= 4)
{
comboBox4.Text = Program.LocalSettings.LastSNTexts[3];
checkBox4.Checked = !string.IsNullOrEmpty(comboBox4.Text);
}
if (WaterMetersCount >= 5)
{
comboBox5.Text = Program.LocalSettings.LastSNTexts[4];
checkBox5.Checked = !string.IsNullOrEmpty(comboBox5.Text);
}
if (WaterMetersCount >= 6)
{
comboBox6.Text = Program.LocalSettings.LastSNTexts[5];
checkBox6.Checked = !string.IsNullOrEmpty(comboBox6.Text);
}
for (int i = 0; i < WaterMetersCount; i++)
{
comboBoxes[i].Text = Program.LocalSettings.LastSNTexts[i];
checkBoxes[i].Checked = !string.IsNullOrEmpty(comboBoxes[i].Text);
}
}
private void comboBox1_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
@@ -236,12 +239,11 @@ namespace TBF.BenchControl.DataEntry.Standard6
private void clearButton_Click(object sender, EventArgs e)
{
if (WaterMetersCount >= 1) { comboBox1.Text = string.Empty; checkBox1.Checked = false; }
if (WaterMetersCount >= 2) { comboBox2.Text = string.Empty; checkBox2.Checked = false; }
if (WaterMetersCount >= 3) { comboBox3.Text = string.Empty; checkBox3.Checked = false; }
if (WaterMetersCount >= 4) { comboBox4.Text = string.Empty; checkBox4.Checked = false; }
if (WaterMetersCount >= 5) { comboBox5.Text = string.Empty; checkBox5.Checked = false; }
if (WaterMetersCount >= 6) { comboBox6.Text = string.Empty; checkBox6.Checked = false; }
for (int i = 0; i < WaterMetersCount; i++)
{
comboBoxes[i].Text = string.Empty;
checkBoxes[i].Checked = false;
}
}
@@ -273,11 +275,13 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
{
#if !CEVAK_200
if (e.KeyChar == '+')
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
}
#endif
if (e.KeyChar == '\r')
{
/// Process <enter> key ..... Next text field
File diff suppressed because it is too large Load Diff
@@ -123,13 +123,13 @@ namespace TBF.BenchControl.DataEntry.Standard6
///
void OpenBeginningDlg(EntryFormNoStartEnd myRef)
{
myRef.modelessDlg = new CycleBeginningForm(myRef.waterMeters.Length);
myRef.modelessDlg = new CycleBeginningForm(myRef.waterMeters.Length, (myRef.entryFormCfg.RemarkEnabled && !myRef.entryFormCfg.ShowCycleEndForm));
modelessDlg.Show();
}
///
void OpenEndDlg(EntryFormNoStartEnd myRef)
{
myRef.modelessDlg = new CycleEndForm(myRef.waterMeters.Length, entryFormCfg.RemarkEnabled);
myRef.modelessDlg = new CycleEndForm(myRef.waterMeters.Length, myRef.entryFormCfg.RemarkEnabled);
modelessDlg.Show();
}
///
@@ -201,6 +201,10 @@ namespace TBF.BenchControl.DataEntry.Standard6
{
waterMeters[i].SerialNr = dlg.SNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
if (dlg.RemarksEnabled)
{
waterMeters[i].Remark = dlg.Remark[i];
}
}
}
}
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
double refVolume;
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
bool fixedErrorLimits; /// false in case of calculated error limits
@@ -77,6 +77,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
this.refVolume = refVolume;
this.warningLimLo = 2 * errLimLo;
this.warningLimHi = 2 * errLimHi;
this.fixedErrorLimits = (errLimHi > errLimLo);
InitializeComponent();
WMEndState = new double[waterMetersCount];
@@ -218,7 +219,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
}
catch { };
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation1.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void wmEndStateTextBox2_TextChanged(object sender, EventArgs e)
@@ -232,7 +233,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
}
catch { err = 1000.0f; };
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation2.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void wmEndStateTextBox3_TextChanged(object sender, EventArgs e)
@@ -246,7 +247,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
}
catch { err = 1000.0f; };
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation3.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void wmEndStateTextBox4_TextChanged(object sender, EventArgs e)
@@ -260,7 +261,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
}
catch { err = 1000.0f; };
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation4.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void wmEndStateTextBox5_TextChanged(object sender, EventArgs e)
@@ -274,7 +275,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
}
catch { err = 1000.0f; };
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation5.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void wmEndStateTextBox6_TextChanged(object sender, EventArgs e)
@@ -288,7 +289,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
}
catch { err = 1000.0f; };
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
exclamation6.Visible = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
}
private void wmStartStateTextBox1_KeyPress(object sender, KeyPressEventArgs e)
@@ -31,49 +31,59 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.orderGroupBox.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.TabStop = false;
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.Name = "orderComboBox";
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.orderGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.orderGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.TabStop = false;
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.Name = "orderComboBox";
//
// pictureBox
//
resources.ApplyResources(this.pictureBox, "pictureBox");
this.pictureBox.Name = "pictureBox";
this.pictureBox.TabStop = false;
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.pictureBox);
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.orderGroupBox.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
}
@@ -82,5 +92,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox orderGroupBox;
private System.Windows.Forms.ComboBox orderComboBox;
private System.Windows.Forms.PictureBox pictureBox;
}
}
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
using System.Drawing;
namespace TBF.BenchControl.DataEntry.iPerl
{
@@ -15,6 +16,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// <summary> Number of water meters </summary>
public readonly int WaterMetersCount;
public readonly bool reversedDirection;
/// To be retrieved after the form is closed
public string PurchaseOrder;
@@ -41,10 +43,11 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
public CycleBeginningForm(int waterMetersCount, bool reversedDirection)
: this()
{
this.WaterMetersCount = waterMetersCount;
this.reversedDirection = reversedDirection;
SNText = null;
Disabled = null;
}
@@ -56,6 +59,33 @@ namespace TBF.BenchControl.DataEntry.iPerl
orderGroupBox.Text = Strings.Purchase_order;
okButton.Text = Strings.OkBtnText;
PrepareOrderCombo(orderComboBox);
///
/// Draw an appropriate test bench picture
///
Config.Entities.Side side = (TBF.BenchControl.Sequences.ProcessData.BenchInfo is BenchInfo.iPerl.Component)
? (TBF.BenchControl.Sequences.ProcessData.BenchInfo as BenchInfo.iPerl.Component).Side
: Config.Entities.Side.Left;
if (reversedDirection && (side == Config.Entities.Side.Left))
{
/// direction L->R (reversed), left side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir_left.jpg", Program.ExecutableDir, true));
}
else if (reversedDirection && (side == Config.Entities.Side.Right))
{
/// direction L->R (reversed), right side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir_right.jpg", Program.ExecutableDir, true));
}
else if (side == Config.Entities.Side.Right)
{
/// direction R->L (forward), right side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\forward_dir_right.jpg", Program.ExecutableDir, true));
}
else
{
/// direction R->L (forward), left side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\forward_dir_left.jpg", Program.ExecutableDir, true));
}
}
/// <summary>
@@ -144,13 +144,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="orderComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>90, 31</value>
<value>90, 32</value>
</data>
<data name="orderComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>376, 31</value>
<value>432, 31</value>
</data>
<data name="orderComboBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -174,7 +174,7 @@
<value>28, 12</value>
</data>
<data name="orderGroupBox.Size" type="System.Drawing.Size, System.Drawing">
<value>537, 82</value>
<value>565, 82</value>
</data>
<data name="orderGroupBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -192,6 +192,27 @@
<value>$this</value>
</data>
<data name="&gt;&gt;orderGroupBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="pictureBox.Location" type="System.Drawing.Point, System.Drawing">
<value>28, 118</value>
</data>
<data name="pictureBox.Size" type="System.Drawing.Size, System.Drawing">
<value>711, 497</value>
</data>
<data name="pictureBox.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;pictureBox.Name" xml:space="preserve">
<value>pictureBox</value>
</data>
<data name="&gt;&gt;pictureBox.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;pictureBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -204,7 +225,7 @@
<value>True</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>801, 119</value>
<value>769, 639</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Batch data</value>
@@ -124,7 +124,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
///
void OpenBeginningDlg(EntryForm myRef)
{
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount);
myRef.modelessDlg = new CycleBeginningForm(Config.Data.WMsCount, myRef.entryFormCfg.ReversedDirection);
modelessDlg.Show();
}
///
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -20,6 +20,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// Serialized parameters
///
public bool ShowCycleEndForm;
public bool ReversedDirection;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
@@ -27,6 +28,8 @@ namespace TBF.BenchControl.DataEntry.iPerl
Name = "DataEntry-iPerl";
ParentName = string.Empty;
ShowCycleEndForm = false;
ReversedDirection = false;
}
public EntryFormCfg(IComponentFactory factory)
@@ -37,7 +40,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
public string ToString(int i)
{
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm);
return string.Format("Name={0}, ShowEndForm={1}, ReversedDir={2}", Name, ShowCycleEndForm, ReversedDirection);
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@@ -50,12 +50,14 @@ namespace TBF.BenchControl.DataEntry.iPerl
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
reversedIperlDirectionCheckBox.Checked = config.ReversedDirection;
}
public void Unlock()
{
nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true;
reversedIperlDirectionCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -72,6 +74,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
config.ReversedDirection = reversedIperlDirectionCheckBox.Checked;
return flags;
}
+70 -56
View File
@@ -31,62 +31,75 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(131, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(32, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(128, 32);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// showCycleEndFormCheckBox
//
this.showCycleEndFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.TabIndex = 13;
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.showCycleEndFormCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
this.reversedIperlDirectionCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(131, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(32, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(128, 32);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// showCycleEndFormCheckBox
//
this.showCycleEndFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90);
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.TabIndex = 13;
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
//
// reversedIperlDirectionCheckBox
//
this.reversedIperlDirectionCheckBox.AutoSize = true;
this.reversedIperlDirectionCheckBox.Enabled = false;
this.reversedIperlDirectionCheckBox.Location = new System.Drawing.Point(131, 113);
this.reversedIperlDirectionCheckBox.Name = "reversedIperlDirectionCheckBox";
this.reversedIperlDirectionCheckBox.Size = new System.Drawing.Size(158, 17);
this.reversedIperlDirectionCheckBox.TabIndex = 14;
this.reversedIperlDirectionCheckBox.Text = "Reversed direction of iPerl-s";
this.reversedIperlDirectionCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.reversedIperlDirectionCheckBox);
this.Controls.Add(this.showCycleEndFormCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -96,5 +109,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showCycleEndFormCheckBox;
private System.Windows.Forms.CheckBox reversedIperlDirectionCheckBox;
}
}
+5 -3
View File
@@ -5,10 +5,11 @@ using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Dummy.Balance
{
public class Component : ComponentBase, GenericDevices.IScale, IOperation
public class Component : ComponentBase, IScale, IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
@@ -28,8 +29,9 @@ namespace TBF.BenchControl.Dummy.Balance
public int ScaleNr { get { return 0; } }
public double Capacity { get { return 10000.0; } }
public GenericDevices.IValve DrainValve { get { return null; } }
public bool IsEmpty(double mass) { return true; }
public IValve DrainValve { get { return null; } }
public IValve DrainValve2 { get { return null; } }
public bool ContainsMoreThen(float thld) { return (thld == 0); }
public bool IsEmpty() { return true; }
public string Format { get { return "F3"; } }
public int EmptyTimeSec { get { return 5; } }
+1 -1
View File
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
EnduranceCycleStop = 13,
}
#if FUZHOU_300 || PT200IL || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || DUBAJ_50
#if FUZHOU_300 || IZRAEL_200 || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7, /// bits 0,1,2
+23 -15
View File
@@ -126,7 +126,7 @@ namespace TBF.BenchControl.Elde
public uint[] DiverterEdge; /// Created and initialized in this.Initialize()
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU_150 || FUZHOU_300 || PT200IL || PUCHONG_200 || SLM_150 || SENTEC || CEVAK_200
#if DN100 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || PUCHONG_200 || SLM_150 || SENTEC || CEVAK_200
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
@@ -137,11 +137,15 @@ namespace TBF.BenchControl.Elde
{100,500}, {100,500}, {100,500}, {100,500} };
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || FUZHOU_100 || DUBAJ_50
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FUZHOU_100
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
#elif SLM_END || WARSAW_END
#elif IZRAEL_50 || SLM_END
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[7]; /// Modbus addresses of Pr1, Pr2, Pr3, Pr4, Pr5, Pr6, T9 (Izrael) or Pr1, Pr2, Pr3, Pr4, T9, T10 (SLM END)
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
#elif WARSAW_END
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
@@ -217,19 +221,31 @@ namespace TBF.BenchControl.Elde
}
}
public void UpdateWeights()
{
/// Mettler-Toledo scales
for (int i = 0; i < MettlerToledo.Standard.BalanceDev.BalancesCount; i++)
{
controlCom.SetWeight(i, MettlerToledo.Standard.BalanceDev.Masses[i]);
}
/// Mettler-Toledo-multi scales (Badger Brno, ...)
for (int i = 0; i < MettlerToledo.Multi.BalanceDev.BalancesCount; i++)
{
controlCom.SetWeight(i, MettlerToledo.Multi.BalanceDev.Masses[i]);
}
}
/// Tanks (CEVAK, ...)
int firstTankIx = Math.Max(MettlerToledo.Standard.BalanceDev.BalancesCount, MettlerToledo.Multi.BalanceDev.BalancesCount);
for (int i = 0; i < Various.TankWithLevelMsrmnt.Tank.TanksCount; i++)
{
controlCom.SetWeight(firstTankIx + i, Various.TankWithLevelMsrmnt.Tank.Tanks[i].Volume);
}
}
public void SetReservoirTemp(int nr, float temp)
{
controlCom.SetReservoirTemp(nr, temp);
@@ -280,7 +296,7 @@ namespace TBF.BenchControl.Elde
ControlComponent3Munich.UserControl1 ctrlBrdComponent,
#elif FUZHOU_300
ControlComponent3F300.UserControl1 ctrlBrdComponent,
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif IZRAEL_200 || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
#else /// all newer benches
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
@@ -430,6 +446,8 @@ namespace TBF.BenchControl.Elde
{
if (DebugLevel == DebugMode.Simulate) return;
UpdateWeights();
uint[] uintFilters = new uint[8];
for (int i = 0; i < 8; i++)
{
@@ -660,15 +678,5 @@ namespace TBF.BenchControl.Elde
{
return new ExecuteCommandOp(this, commandOnStartOp, commandOnStopOp, testMethod);
}
/// <summary>
/// Updates the tank drawing and weight value in Elde software component.
/// </summary>
/// <param name="weight">Current mass in [kg] or approx. volume in [l]</param>
/// <returns>Created operation</returns>
public IOperation UpdateTankWeightOp()
{
return new UpdateTankWeightOp(this);
}
}
}
+15 -15
View File
@@ -35,10 +35,10 @@ namespace TBF.BenchControl.Elde
public int EtPulses(int wmNr1) { return (int)ctrlBrdComponent.etPulses[wmNr1]; }
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || DUBAJ_50
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
#else
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40 || PUCHONG_200 || MALTA_WSD25
public int EtPulsesK { get { return 1; } }
#else /// all new benches
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
#endif
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
@@ -62,7 +62,7 @@ namespace TBF.BenchControl.Elde
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
#endif
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || DUBAJ_50 || CEVAK_200
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
{
@@ -106,7 +106,7 @@ namespace TBF.BenchControl.Elde
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
public uint AnalogInputRaw(int adcNr0, int bank) { return ctrlBrdComponent.AnalogyRaw[adcNr0, bank]; } /// bank0=RV, bank1=Temp
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || PT200IL || PUCHONG_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || PUCHONG_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
#else /// all new test benches
@@ -122,7 +122,7 @@ namespace TBF.BenchControl.Elde
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
#endif
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || FUZHOU_100
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FUZHOU_100 || CEVAK_200 || IZRAEL_50
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
#else
public float ValveOpenCloseTime { get { return 0.001f; } }
@@ -158,7 +158,7 @@ namespace TBF.BenchControl.Elde
private ControlComponent3Munich.UserControl1 ctrlBrdComponent;
#elif FUZHOU_300
private ControlComponent3F300.UserControl1 ctrlBrdComponent;
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif IZRAEL_200 || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
#else /// newer benches
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
@@ -174,7 +174,7 @@ namespace TBF.BenchControl.Elde
public ControlComWrap(ControlComponent3Munich.UserControl1 ctrlBrdComponent)
#elif FUZHOU_300
public ControlComWrap(ControlComponent3F300.UserControl1 ctrlBrdComponent)
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif IZRAEL_200 || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
public ControlComWrap(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
#else /// all newer benches
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
@@ -225,7 +225,7 @@ namespace TBF.BenchControl.Elde
log.FatalFormat("Component: {0}", ControlComponent3Munich.UserControl1.ProgVersion);
#elif FUZHOU_300
log.FatalFormat("Component: {0}", ControlComponent3F300.UserControl1.ProgVersion);
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif IZRAEL_200 || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
log.FatalFormat("Component: {0}", ControlComponent_Izrael2014.UserControl1.ProgVersion);
#else /// newer benches
log.FatalFormat("Component: {0}", ControlComponent_Torino2015.UserControl1.ProgVersion);
@@ -245,8 +245,8 @@ namespace TBF.BenchControl.Elde
ctrlBrdComponent.ExternalCom = true;
#if SENTEC || CEVAK_200
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange, (byte)123);
#if SENTEC || CEVAK_200 || FUZHOU_100 || IZRAEL_25
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange, (byte)0Xff);
#else
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange);
#endif
@@ -369,7 +369,7 @@ namespace TBF.BenchControl.Elde
cmd, /// 0
refFlowMeterNr, /// 1
Utils.RouteToStr(route), /// 2
totalRefPulses, massRefPulses, testMethods, filterConstants, /// 3, 4, 5, 6
totalRefPulses, massRefPulses, testMethods, filterConstants, /// 3, 4, 5, 6
fmFreq[0].ToString(), /// 7
(fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "", /// 8
(fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "", /// 9
@@ -381,7 +381,7 @@ namespace TBF.BenchControl.Elde
#if DN100 || MUNICH
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || PT200IL || PUCHONG_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || IZRAEL_200 || PUCHONG_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif BERLIN || SLM_150 || PETERSBURG_200
@@ -392,11 +392,11 @@ namespace TBF.BenchControl.Elde
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200
#elif JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || IZRAEL_50
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || DUBAJ_50
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
@@ -103,6 +103,10 @@ namespace TBF.BenchControl.Elde.Diverter
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
#elif BADGER_VELKA_TRAT
flowMtrNr4Cmd = ((divNrFromName % 10) == 1) ? 0x11 : (((divNrFromName % 10) == 2) ? 0x22 : 0x33);
#elif FUZHOU_100
flowMtrNr4Cmd = divNrFromName;
#elif CEVAK_200
flowMtrNr4Cmd = (divNrFromName == 4) ? 5 : divNrFromName;
#else
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 3;
#endif
@@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.FlowMeter
{
public class FlowMeterCfg : ComponentCfgBase, GenericDevices.ICalibInfoCfg, IChildComponentCfg
public class FlowMeterCfg : ComponentCfgBase, GenericDevices.ICalibRangesCfg, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -134,6 +134,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
public void Stop()
{
log.DebugFormat("{0}:Stop()", Name);
}
ReadPulses();
}
}
}
+14 -14
View File
@@ -24,7 +24,7 @@ namespace TBF.BenchControl.Elde.RegulValve
readonly IFlowMeter flowMeter;
readonly float requiredFlowLo;
readonly float requiredFlowHi;
readonly float requiredFlowAve;
readonly float reqFlowAve;
readonly float pidCoef;
readonly int timeout;
readonly bool leaveMeasurementRunning;
@@ -92,9 +92,9 @@ namespace TBF.BenchControl.Elde.RegulValve
nominalFlow = flowMeter.NominalFlow;
this.requiredFlowLo = requiredFlowLo;
this.requiredFlowHi = requiredFlowHi;
this.requiredFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f;
this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f;
this.requiredFlowLo = (0.7F * requiredFlowLo) + (0.3F * this.reqFlowAve); /// Move the lower limit 15% of the range up
this.requiredFlowHi = (0.7F * requiredFlowHi) + (0.3F * this.reqFlowAve); /// Move the upper limit 15% of the range down
this.pidCoef = pidCoef;
if (flowBox == null) throw new ArgumentNullException("flowBox");
@@ -155,7 +155,7 @@ namespace TBF.BenchControl.Elde.RegulValve
void StoreTargetPosition(float avgReqFlow, float actPosition)
{
if (!regulValve.Dict.ContainsKey(requiredFlowAve))
if (!regulValve.Dict.ContainsKey(reqFlowAve))
{
regulValve.Dict.Add(new KeyValuePair<float, float>(avgReqFlow, actPosition));
}
@@ -173,13 +173,13 @@ namespace TBF.BenchControl.Elde.RegulValve
if (flow != 0)
{
flowBox.Val = flow;
if (flow >= requiredFlowAve) currentReqFlowHi = requiredFlowAve; /// Decrease upper limit
if (flow <= requiredFlowAve) currentReqFlowLo = requiredFlowAve; /// Increase lower limit
if (flow >= reqFlowAve) currentReqFlowHi = reqFlowAve; /// Decrease upper limit
if (flow <= reqFlowAve) currentReqFlowLo = reqFlowAve; /// Increase lower limit
}
flowWithinBoundsTime = 0;
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(requiredFlowAve, out targetPositionLo, out targetPositionHi))
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi))
{
log.InfoFormat("SetFlowOp:Start() rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
regulValveNr, flowMeter.Idx1, currentReqFlowLo, currentReqFlowHi, targetPositionLo, targetPositionHi);
@@ -231,7 +231,7 @@ namespace TBF.BenchControl.Elde.RegulValve
{
flowWithinBoundsTime = 0;
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(requiredFlowAve, out targetPositionLo, out targetPositionHi))
if (regulValve.RegulValveCfg.StoredPositionReuse && FetchTargetPosition(reqFlowAve, out targetPositionLo, out targetPositionHi))
{
log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3} FETCHED: posLo={4} posHi={5}",
regulValveNr, flowMeter.Idx1, currentReqFlowLo, currentReqFlowHi, targetPositionLo, targetPositionHi);
@@ -396,19 +396,19 @@ namespace TBF.BenchControl.Elde.RegulValve
if (regulValve.RegulValveCfg.StoredPositionReuse)
{
float storedPosition;
if (regulValve.Dict.TryGetValue(requiredFlowAve, out storedPosition))
if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition))
{
/// update the stored valve position
StoreTargetPosition(requiredFlowAve, (rvPosition + storedPosition) / 2.0f);
StoreTargetPosition(reqFlowAve, (rvPosition + storedPosition) / 2.0f);
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position",
regulValveNr, requiredFlowAve, rvPosition.ToString("F1"), storedPosition);
regulValveNr, reqFlowAve, rvPosition.ToString("F1"), storedPosition);
}
else
{
/// store the valve position
StoreTargetPosition(requiredFlowAve, rvPosition);
StoreTargetPosition(reqFlowAve, rvPosition);
log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% <--- Storing a new position",
regulValveNr, requiredFlowAve, rvPosition.ToString("F1"));
regulValveNr, reqFlowAve, rvPosition.ToString("F1"));
}
}
@@ -102,9 +102,9 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
nominalFlow = flowMeter.NominalFlow;
this.finalReqFlowLo = requiredFlowLo;
this.finalReqFlowHi = requiredFlowHi;
this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2;
this.finalReqFlowLo = (0.7F * requiredFlowLo) + (0.3F * this.reqFlowAve); /// Move the lower limit 15% of the range up
this.finalReqFlowHi = (0.7F * requiredFlowHi) + (0.3F * this.reqFlowAve); /// Move the upper limit 15% of the range down
this.pidCoef = pidCoef;
this.measuredFlow = measuredFlow;
this.reTryCommands = reTryCmds;
@@ -108,10 +108,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
nominalFlow = flowMeter.NominalFlow;
this.finalReqFlowLo = requiredFlowLo;
this.finalReqFlowHi = requiredFlowHi;
this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2.0f;
this.pidCoef = pidCoef;
this.finalReqFlowLo = (0.7F * requiredFlowLo) + (0.3F * this.reqFlowAve); /// Move the lower limit 15% of the range up
this.finalReqFlowHi = (0.7F * requiredFlowHi) + (0.3F * this.reqFlowAve); /// Move the upper limit 15% of the range down
this.pidCoef = pidCoef;
this.measuredFlow = measuredFlow;
this.timeout = timeout;
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.TempMeterMeret
{
public class Factory : IComponentFactory
{
public string ClassName { get { return "TempMeterMeret"; } }
public void ResetStaticProperties() { TempMeter.ResetStaticProperties(); }
public IComponent DummyComponent() { return new TempMeter(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new TempMeter(cfg, components); }
public IComponentCfg DefaultConfig() { return new TempMeterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TempMeterCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,61 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using log4net;
using TBF.Boxes;
namespace TBF.BenchControl.Elde.TempMeterMeret
{
public class ReadTempOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadTempOp));
public override string ToString() { return string.Format("ReadTempOp({0},.,{1})", tempMeter.Name, eventDone); }
/// Set by the constructor
TempMeter tempMeter;
Event eventDone;
DoubleBox temp;
/// <summary>
/// Events: TempInDone, TempOutDone, TempDivDone or Error
/// </summary>
/// <param name="tempMeter">TempMeter reference</param>
/// <param name="temp">Reference to the variable, value is in degree Celsius</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public ReadTempOp(TempMeter tempMeter, ref DoubleBox temp, Event eventDone)
{
if (tempMeter == null) throw new ArgumentNullException("tempMeter");
this.tempMeter = tempMeter;
this.temp = temp;
this.eventDone = eventDone;
log.Debug(this.ToString());
}
public ReadTempOp(TempMeter tempMeter, ref DoubleBox temp)
: this(tempMeter, ref temp, Event.TempDone)
{
}
/// <summary>Start this operation</summary>
public void Start()
{
temp.Val = tempMeter.ReadTemperature();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.TempInDone, Event.TempOutDone or Event.TempDivDone
/// </returns>
public Event Run()
{
temp.Val = tempMeter.ReadTemperature();
return eventDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -0,0 +1,62 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.Boxes;
namespace TBF.BenchControl.Elde.TempMeterMeret
{
public class TempMeter : ComponentBase, GenericDevices.ITempMeter
{
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString() { return string.Format("TempMeter({0})", Cfg.ToString(1)); }
readonly TempMeterCfg tempMtrCfg;
public readonly ControlBoardDev ControlBoard;
public TempMeter() {}
public TempMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
tempMtrCfg = cfg as TempMeterCfg;
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
/// Prepare data for SendCalibData() control board component method
ControlBoard.MeretRS485Address[tempMtrCfg.MeretIdx0] = tempMtrCfg.ModbusAddress;
log.Debug(this.ToString());
}
public double ReadTemperature()
{
return Config.Formulas.CorrectedValue((double)ControlBoard.Temperature(tempMtrCfg.TempIdx0), Corrections);
}
/// <summary>
/// Events: TempDone, Error
/// </summary>
/// <param name="temp">Reference to a variable for the temperature in Celsius</param>
/// <returns>ReadTempOp instance reference casted to IOperaton</returns>
public IOperation ReadTempOp(ref DoubleBox temp)
{
return new ReadTempOp(this, ref temp);
}
/// <summary>
/// Events: tempDone, Error
/// </summary>
/// <param name="temp">Reference to a variable for the temperature in Celsius</param>
/// <param name="tempDone">Event returned when measurement done</param>
/// <returns>ReadTempOp instance reference casted to IOperaton</returns>
public IOperation ReadTempOp(ref DoubleBox temp, Event tempDone)
{
return new ReadTempOp(this, ref temp, tempDone);
}
}
}
@@ -0,0 +1,183 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.TempMeterMeret
{
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl()
{
IList<string> parents = new List<string>();
parents.Add("CB");
// TODO:
//if (StateMachine.Components != null)
//{
// foreach (var cmpnt in StateMachine.Components)
// {
// if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Modbus.Common.Factory)
// {
// parents.Add(cmpnt.Name);
// }
// }
//}
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
}
///
/// Serialized parameters
///
public int TempIdx0; /// 0..19
public byte ModbusAddress; /// 1..247
public int MeretIdx0; /// Meter pressure meters count .. (Meter pressure meters count + Meter temperature meters count - 1)
/// Private parameterless constructor invoked by all other (public) constructors
TempMeterCfg()
{
Name = "T";
ParentName = "CB";
}
public TempMeterCfg(IComponentFactory factory)
: this()
{
Factory = factory;
Name = "T";
ParentName = "CB";
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
TempIdx0 = 8;
ModbusAddress = 1;
MeretIdx0 = 4;
}
string[] paramNames = new string[]
{
"Temp. index (0)",
"Modbus address",
"Meret index (0)",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
if (i == -1)
{
return string.Format("Name={0}, Parent={1}, TempIx0={2}, Modbus address={3}, MeretIx0={4}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
TempIdx0, ModbusAddress, MeretIdx0);
}
switch (i)
{
case 0: return TempIdx0.ToString();
case 1: return ModbusAddress.ToString();
case 2: return MeretIdx0.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
int ival = int.Parse(strValue);
if (TempIdx0 != ival)
{
TempIdx0 = ival;
return CfgUpdateFlags.RestartRqrd;
}
else return CfgUpdateFlags.None;
case 1:
byte addr = byte.Parse(strValue);
if (ModbusAddress != addr)
{
ModbusAddress = addr;
return CfgUpdateFlags.RestartRqrd;
}
else return CfgUpdateFlags.None;
case 2:
int ival2 = int.Parse(strValue);
if (MeretIdx0 != ival2)
{
MeretIdx0 = ival2;
return CfgUpdateFlags.RestartRqrd;
}
else return CfgUpdateFlags.None;
default:
return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int dummy;
switch (i)
{
case 0:
if (int.TryParse(strValue, out dummy) && dummy >= 0 && dummy <= 19) return true;
break;
case 1:
if (int.TryParse(strValue, out dummy) && dummy >= 1 && dummy <= 247) return true;
message = ParamName(i) + " is invalid. Address range is 1 .. 247";
return false;
case 2:
if (int.TryParse(strValue, out dummy) && dummy >= 0 && dummy <= 19) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(TempMeterCfg prms)
{
prms.ParentName = this.ParentName;
prms.TempIdx0 = this.TempIdx0;
prms.ModbusAddress = this.ModbusAddress;
prms.MeretIdx0 = this.MeretIdx0;
}
public Config.Entities.IParamsProvider Clone()
{
TempMeterCfg pars = new TempMeterCfg();
CopyContentTo(pars);
return pars;
}
public void UpdateEmbeddedDbEntity()
{
/// Do nothing
}
}
}
@@ -1,51 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using log4net;
namespace TBF.BenchControl.Elde
{
public class UpdateTankWeightOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(UpdateTankWeightOp));
public override string ToString() { return string.Format("UpdateTankWeightOp(.)"); }
/// Set by the constructor
readonly ControlBoardDev controlBoard;
/// <summary>
/// Stop the previous control board operation (diverter, gate, etc.)
/// Events: None or PreviousStopped
/// </summary>
/// <param name="controlBoardDev">Control board component reference</param>
public UpdateTankWeightOp(ControlBoardDev controlBoardDev)
{
if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev");
this.controlBoard = controlBoardDev;
log.Debug(this.ToString());
}
/// <summary>Start this operation</summary>
public void Start()
{
controlBoard.UpdateWeights();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.None or Event.PreviousStopped
/// </returns>
public Event Run()
{
controlBoard.UpdateWeights();
return Event.None;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
+3 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl
{
@@ -93,6 +93,8 @@ namespace TBF.BenchControl
TempInDone,
TempOutDone,
TempDivDone,
LevelDone,
VolumeDone,
FlowMeasurementDone,
FlowReached,
PositionReached,
@@ -19,5 +19,5 @@ namespace TBF.BenchControl.GenericDevices
string Address4 { get; }
string Address5 { get; }
RemoteDBUse RemoteDBUse { get; }
}
}
}
@@ -1,30 +1,18 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
/// Copyright (c) 2018 Sensus Metering Systems
///
using System;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.GenericDevices
{
public interface ICalibInfoCfg : IComponentCfg
{
public interface ICalibInfoCfg : IComponentCfg
{
///
/// Access to parameters displayed in Metrology tab page
/// Parameters displayed in Metrology tab page
///
bool RangeEnabled(int rangeIx1);
double GetTempLo(int rangeIx1);
double GetTempHi(int rangeIx1);
double GetPressLo(int rangeIx1);
double GetPressHi(int rangeIx1);
string GetCalibCertificate(int rangeIx1); /// Get calibration certificate number
DateTime GetCalibDate(int rangeIx1); /// Get the date of calibration
DateTime GetCalibValidDate(int rangeIx1); /// Get calibration valid until (date)
void SetCalibCertificate(int rangeIx1, string certificate); /// Set calibration certificate number
void SetCalibDate(int rangeIx1, DateTime date); /// Get the date of calibration
void SetCalibValidDate(int rangeIx1, DateTime date); /// Get calibration valid until (date)
string CalibCertificateNr { get; set; } /// calibration certificate number
DateTime CalibDate { get; set; } /// date of calibration
DateTime CalibValidDate { get; set; } /// calibration valid until (date)
}
}
@@ -0,0 +1,30 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.GenericDevices
{
public interface ICalibRangesCfg : IComponentCfg
{
///
/// Access to parameters displayed in Metrology tab page
///
bool RangeEnabled(int rangeIx1);
double GetTempLo(int rangeIx1);
double GetTempHi(int rangeIx1);
double GetPressLo(int rangeIx1);
double GetPressHi(int rangeIx1);
string GetCalibCertificate(int rangeIx1); /// Get calibration certificate number
DateTime GetCalibDate(int rangeIx1); /// Get the date of calibration
DateTime GetCalibValidDate(int rangeIx1); /// Get calibration valid until (date)
void SetCalibCertificate(int rangeIx1, string certificate); /// Set calibration certificate number
void SetCalibDate(int rangeIx1, DateTime date); /// Get the date of calibration
void SetCalibValidDate(int rangeIx1, DateTime date); /// Get calibration valid until (date)
}
}
+1 -10
View File
@@ -15,16 +15,7 @@ namespace TBF.BenchControl.GenericDevices
/// They are calculated inside this function as required by Modbus specification.
/// </summary>
/// <param name="message">Message incl CRC fields, CRC bytes dont have to be set</param>
void SendMessage(byte[] message);
/// <summary>
/// Send a structured modbus message.
/// </summary>
/// <param name="modbusAddress">Device address (1..255) or 0 = broadcast</param>
/// <param name="function">Function (0..127)</param>
/// <param name="dataAddress">Address of data to be transferred (0..65535)</param>
/// <param name="dataCount">Count of data bytes to be transferred (0..65535)</param>
void SendMessage(byte modbusAddress, byte function, ushort dataAddress, ushort dataCount);
void SendMessage(int preambLen, byte[] message);
Queue<byte[]>[] ReceivedTelegrams { get; }
}
@@ -0,0 +1,41 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.GenericDevices
{
/// <summary>
/// Basic level meter functions
/// </summary>
public interface ILevelMeter
{
/// <summary>
/// Measurement correction table
/// </summary>
IList<MeasurementCorrection> Corrections { get; }
/// <summary>
/// Continuosly measured level in mm (last measured level in case of ManualLevelMsrmnt)
/// </summary>
double Level { get; }
/// <summary>
/// Events: Busy, LevelDone, Error
/// </summary>
/// <param name="level">Reference to a variable for the measured level in mm</param>
/// <returns>ReadLevelOp instance reference casted to IOperaton</returns>
IOperation ReadLevelOp(ref DoubleBox level);
/// <summary>
/// Events: Busy, LevelDone, Error
/// </summary>
/// <param name="level">Reference to a variable for the measured level in mm</param>
/// <returns>ReadLevelOp instance reference casted to IOperaton</returns>
IOperation ReadStableLevelOp(ref DoubleBox level, double sdev);
}
}
+3 -45
View File
@@ -1,61 +1,19 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.GenericDevices
{
/// <summary>
/// Basic balance functions
/// Scale with a water tank functions
/// </summary>
public interface IScale : IComponent
public interface IScale : IScaleOrTank
{
/// <summary>
/// Balance number: 0-based index required for communication with the Elde component
/// </summary>
int ScaleNr { get; }
/// <summary>
/// Balance water tank capacity in kg or ltr
/// </summary>
double Capacity { get; }
/// <summary>
/// Water tank drain valve or 'null'
/// </summary>
IValve DrainValve { get; }
/// <summary>
/// Returns true if tank s empty, mass is less then some threshold
/// </summary>
bool IsEmpty(double mass);
/// <summary>
/// Returns true if tank s empty, the last measured mass is less then some threshold
/// </summary>
bool IsEmpty();
/// <summary>
/// Format string to be used as ToString() argument (e.g. "F3" to obtain resolution 1g)
/// </summary>
string Format { get; }
/// <summary>
/// Time in seconds to empty the tank completely when it is full
/// </summary>
int EmptyTimeSec { get; }
float BuoyancyTemp { get; } ///
float BuoyancyPress { get; } /// Displayed in Metrology tab page
float BuoyancyHumi { get; } ///
/// <summary>
/// Measurement correction table
/// </summary>
IList<Config.Entities.MeasurementCorrection> Corrections { get; }
/// <summary>
/// Events: BalanceDone, Error
/// </summary>
+2 -6
View File
@@ -6,7 +6,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.GenericDevices
{
public interface IScaleCfg : IComponentCfg
public interface IScaleCfg : ICalibInfoCfg
{
///
/// Parameters displayed in Metrology tab page
@@ -14,11 +14,7 @@ namespace TBF.BenchControl.GenericDevices
float BuoyancyTemp { get; set; } /// ambient temperature in [degree C]
float BuoyancyPress { get; set; } /// ambient pressure in [100000 Pa]
float BuoyancyHumi { get; set; } /// ambient relative humidity in [%]
float WeightStandardDensity { get; set; } /// density of the weight standard used to calibrate the scale [kg/m3]
string CalibCertificateNr { get; set; } /// calibration certificate number
DateTime CalibDate { get; set; } /// date of calibration
DateTime CalibValidDate { get; set; } /// calibration valid until (date)
float WeightStandardDensity { get; set; } /// density of the weight standard used to calibrate the scale [kg/m3]
}
}
@@ -0,0 +1,56 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.GenericDevices
{
/// <summary>
/// Water tank functions (either on a scale or with height/volume measurement)
/// </summary>
public interface IScaleOrTank : IComponent
{
/// <summary>
/// Balance number: 0-based index required for communication with the Elde component
/// </summary>
int ScaleNr { get; }
/// <summary>
/// Balance water tank capacity in kg or ltr
/// </summary>
double Capacity { get; }
/// <summary>
/// Water tank drain valve or 'null'. DrainValve2 is open in the 2nd half of drain time period
/// </summary>
IValve DrainValve { get; }
IValve DrainValve2 { get; }
/// <summary>
/// Returns true if tank is empty, the last measured mass is less then some threshold
/// </summary>
bool IsEmpty();
/// <summary>
/// Returns true if tank contains more then 'thld' kg or l of water
/// </summary>
bool ContainsMoreThen(float thld);
/// <summary>
/// Format string to be used as ToString() argument (e.g. "F3" to obtain resolution 1g)
/// </summary>
string Format { get; }
/// <summary>
/// Time in seconds to empty the tank completely when it is full
/// </summary>
int EmptyTimeSec { get; }
/// <summary>
/// Measurement correction table
/// </summary>
IList<Config.Entities.MeasurementCorrection> Corrections { get; }
}
}
@@ -12,5 +12,6 @@ namespace TBF.BenchControl.GenericDevices
{
IValve DrainValve { get; }
bool IsEmpty();
bool ContainsMoreThen(float thld);
}
}
@@ -0,0 +1,40 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.GenericDevices
{
public interface IVolumeMeter
{
/// <summary>
/// Measurement correction table
/// </summary>
IList<MeasurementCorrection> Corrections { get; }
/// <summary>
/// Events: VolumeDone, Error
/// </summary>
/// <param name="volume">Reference to a variable for the measured volume in l</param>
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
IOperation ReadVolumeOp(ref DoubleBox volume);
/// <summary>
/// Events: VolumeDone, Error
/// </summary>
/// <param name="volume">Reference to a variable for the measured volume in l</param>
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
IOperation ReadStableVolumeOp(ref DoubleBox volume, double sdev);
/// <summary>
/// Events: VolumeDone, Error
/// </summary>
/// <param name="volume">Reference to a variable for the measured volume in l</param>
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
IOperation ManualReadVolumeOp(ref DoubleBox volume);
}
}
+34
View File
@@ -0,0 +1,34 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.Hart.Common
{
/// <summary>
/// HART start bytes
/// </summary>
public enum Mark : byte
{
ShortFrameMaster2Slave = 0x02,
ShortFrameSlave2Master = 0x06,
LongFrameMaster2Slave = 0x82,
LongFrameSlave2Master = 0x86,
}
/// <summary>
/// HART master addresses
/// </summary>
public enum Master : byte
{
Secondary = 0,
Primary = 0x80,
}
/// <summary>
/// HART commands
/// </summary>
public enum Cmd : byte
{
ReadUniqueID = 0,
ReadPrimaryVar = 1,
}
}
+109 -97
View File
@@ -16,39 +16,49 @@ using TBF.Boxes;
namespace TBF.BenchControl.Hart.Common
{
/// <summary>
/// Root component for Modbus communication via serial port (RS485)
/// Root component for HART communication via a modem connected to a serial port (RS232)
/// </summary>
public class Hart : ComponentBase, IDevice, GenericDevices.IModbus
public class Hart : ComponentBase, IDevice, GenericDevices.IHart
{
private static readonly ILog log = LogManager.GetLogger(typeof(Hart));
public override string ToString() { return string.Format("Modbus({0})", Cfg.ToString(1)); }
private readonly HartCfg modbusCommonCfg;
private readonly HartCfg hartCfg;
/// Private fields
SerialPort serialPort;
DateTime lastSerialPortWrite;
/// <summary>
/// An array of Queue-s of received telegrams fetched by HART components (as Nivotrack).
/// There is one queue for each device (each slave address).
/// </summary>
public Queue<byte[]>[] ReceivedTelegrams
{
get { return receivedTelegrams; }
}
Queue<byte[]>[] receivedTelegrams;
/// <summary>
/// A Queue of telegrams to send. System prevents sending more then one telegram per 500ms.
/// Function SendMessage( ) either send the telegram immediately using SendMessageNow( ) or
/// inserts the telegram into telegramsToSend queue. The queue is emptied in RunDeviceAfter( ).
/// </summary>
Queue<byte[]> telegramsToSend;
public Hart()
{
}
/// <summary>
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware.
/// HART modem connected via serial interface (RS232).
/// Connection settings: 1200 Bd 8-bits odd-parity 1-stop-bit Flow control: none or hardware.
/// </summary>
public Hart(Generic.IComponentCfg cfg)
: base(cfg)
{
receivedTelegrams = new Queue<byte[]>[256];
receivedTelegrams = new Queue<byte[]>[16]; /// Max. 16 slaves with adresses 0..15
for (int i = 0; i < receivedTelegrams.Length; i++)
{
receivedTelegrams[i] = new Queue<byte[]>();
@@ -56,7 +66,7 @@ namespace TBF.BenchControl.Hart.Common
telegramsToSend = new Queue<byte[]>();
serialPort = null;
modbusCommonCfg = cfg as HartCfg;
hartCfg = cfg as HartCfg;
log.Debug(this.ToString());
}
@@ -64,27 +74,62 @@ namespace TBF.BenchControl.Hart.Common
{
}
public void Initialize()
{
if (modbusCommonCfg.DebugLevel == DebugMode.Simulate)
if (hartCfg.DebugLevel == DebugMode.Simulate)
{
serialPort = null;
log.FatalFormat("{0} - Device simulated", Name);
return;
}
string comPortName = "COM" + modbusCommonCfg.ComPortNr.ToString();
serialPort = new SerialPort(comPortName, modbusCommonCfg.BaudRate, modbusCommonCfg.Parity, modbusCommonCfg.DataBits, modbusCommonCfg.StopBits);
serialPort.Handshake = modbusCommonCfg.Handshake;
string comPortName = "COM" + hartCfg.ComPortNr.ToString();
serialPort = new SerialPort(comPortName, hartCfg.BaudRate, hartCfg.Parity, hartCfg.DataBits, hartCfg.StopBits);
serialPort.Handshake = hartCfg.Handshake;
serialPort.Open();
//stopWorkerThread = false;
//workerThread = new Thread(Worker);
//workerThread.Start();
log.FatalFormat("{0} - Device successfully initialized", Name);
}
public void RunDeviceBefore()
{
if (serialPort != null)
{
ParseReceivedData();
}
}
public void RunDeviceAfter()
{
if ((serialPort != null) && (telegramsToSend.Count > 0) && (DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 500))
{
SendMessageNow(telegramsToSend.Dequeue());
}
}
public void StopDevice()
{
if (serialPort != null)
{
serialPort.Close();
serialPort = null;
}
}
public void StopDevice2() { }
public void SendMessageNow(byte[] message)
{
serialPort.Write(message, 0, message.Length);
lastSerialPortWrite = DateTime.Now;
string s = Telegram.LogTelegram(string.Format("{0} - Sending message ", Name), message);
Debug.WriteLine(s);
log.Debug(s);
}
/// <summary>
/// Send an arbitrary modbus message.
@@ -92,21 +137,25 @@ namespace TBF.BenchControl.Hart.Common
/// The last two message bytes (CRC) may be uninitialized or zero.
/// They are calculated inside this function as required by Modbus specification.
/// </summary>
/// <param name="message">Message incl CRC fields, CRC bytes dont have to be set</param>
public void SendMessage(byte[] message)
/// <param name="message">Message incl. a reserved checksum byte, checksum does not have to be set</param>
public void SendMessage(int preambLen, byte[] message)
{
if (serialPort == null) return;
Telegram.UpdateTelegramCRC(message);
Telegram.UpdateTelegramChecksum(message);
byte[] preambAndMessage = new byte[message.Length + preambLen];
if ((DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 100))
for (int i = 0; i < preambLen; i++) preambAndMessage[i] = (byte)0xFF;
for (int i = preambLen; i < preambLen + message.Length; i++) preambAndMessage[i] = message[i - preambLen];
if ((DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 500))
{
/// More then 100 ms since last 'send' --> do not enqueue the message
SendMessageNow(message);
SendMessageNow(preambAndMessage);
}
else
{
telegramsToSend.Enqueue(message);
telegramsToSend.Enqueue(preambAndMessage);
string s = Telegram.LogTelegram(string.Format("{0} - Enqueueing message ", Name), message);
Debug.WriteLine(s);
@@ -114,98 +163,61 @@ namespace TBF.BenchControl.Hart.Common
}
}
/// <summary>
/// Send a structured modbus message.
/// </summary>
/// <param name="modbusAddress">Device address (1..255) or 0 = broadcast</param>
/// <param name="function">Function (0..127)</param>
/// <param name="dataAddress">Address of data to be transferred (0..65535)</param>
/// <param name="dataCount">Count of data bytes to be transferred (0..65535)</param>
public void SendMessage(byte modbusAddress, byte function, ushort dataAddress, ushort dataCount)
void ParseReceivedData()
{
if (serialPort == null) return;
byte[] message = new byte[8]
{
modbusAddress,
function,
(byte)(dataAddress / 256),
(byte)(dataAddress % 256),
(byte)(dataCount / 256),
(byte)(dataCount % 256),
0,
0,
};
SendMessage(message);
}
public void SendMessageNow(byte[] message)
{
serialPort.Write(message, 0, message.Length);
lastSerialPortWrite = DateTime.Now;
string s = Telegram.LogTelegram(string.Format("{0} - Sending message ", Name), message);
Debug.WriteLine(s);
log.Debug(s);
}
/// <summary>Run this device</summary>
public void RunDeviceBefore()
{
if (serialPort == null) return;
int nrBytes = serialPort.BytesToRead;
if (nrBytes > 0)
{
byte[] buffer = new byte[nrBytes];
serialPort.Read(buffer, 0, nrBytes);
/// Read available data
byte[] buf = new byte[nrBytes];
serialPort.Read(buf, 0, nrBytes);
int deviceAddress = (nrBytes >= 1) ? buffer[0] : 0;
int function = (nrBytes >= 2) ? buffer[1] : 0;
if ((nrBytes >= 4) && Telegram.VerifyTelegramCRC(buffer))
/// Determine count of leading FF-s
int preambLen = 0;
for (int i = 0; i < nrBytes; i++)
{
receivedTelegrams[deviceAddress].Enqueue(buffer);
if (buf[i] != (byte)0xFF) break;
preambLen++;
}
string s = string.Format("{0} - {1} address={2} count={3}", Name, Telegram.LogTelegram("Telegram received: ", buffer), deviceAddress, receivedTelegrams[deviceAddress].Count);
int telegramLen = nrBytes - preambLen;
/// Check a telegram length, a checksum, a start byte (S -> M) and a master address (primary)
if (preambLen < 3 ||
telegramLen < 4 ||
!Telegram.VerifyTelegramChecksum(preambLen, buf) ||
((buf[preambLen] != (byte)Mark.ShortFrameSlave2Master) && (buf[preambLen] != (byte)Mark.LongFrameSlave2Master)) ||
((buf[preambLen + 1] & 0x80) != (byte)Master.Primary))
{
string s = Telegram.LogTelegram(string.Format("{0} - Invalid data received ", Name), buf);
Debug.WriteLine(s);
log.Debug(s);
return;
}
/// Strip the preamble
byte[] data = new byte[telegramLen];
for (int i = preambLen; i < nrBytes; i++) data[i - preambLen] = buf[i];
bool isShortFrame = (data[0] == 0x06);
if (isShortFrame)
{
int address = data[1] & 0x0F;
receivedTelegrams[address].Enqueue(data);
string s = string.Format("{0} - {1} address={2} preambLen={3} count={4}", Name, Telegram.LogTelegram("Valid telegram received: ", data), address, preambLen, receivedTelegrams[address].Count);
Debug.WriteLine(s);
log.Debug(s);
}
else
{
string s = Telegram.LogTelegram(string.Format("{0} - Invalid data received ", Name), buffer);
/// TODO
string s = Telegram.LogTelegram(string.Format("{0} - Telegram with long address received ", Name), buf);
Debug.WriteLine(s);
log.Debug(s);
}
}
}
/// <summary>Run this device</summary>
public void RunDeviceAfter()
{
if (serialPort == null) return;
if (telegramsToSend.Count > 0 && (DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 500))
{
SendMessageNow(telegramsToSend.Dequeue());
}
}
/// <summary>Stop this device</summary>
public void StopDevice()
{
if (serialPort != null)
{
//stopWorkerThread = true;
//workerThread.Join(2000);
serialPort.Close();
serialPort = null;
}
}
public void StopDevice2() { }
}
}
+2 -2
View File
@@ -56,9 +56,9 @@ namespace TBF.BenchControl.Hart.Common
public void InitializeAll()
{
ComPortNr = 3;
BaudRate = 9600;
BaudRate = 1200;
DataBits = 8;
Parity = System.IO.Ports.Parity.None;
Parity = System.IO.Ports.Parity.Odd;
StopBits = System.IO.Ports.StopBits.One;
Handshake = System.IO.Ports.Handshake.None;
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace TBF.BenchControl.Hart.Nivotrack
public IComponent DummyComponent() { return new Nivotrack(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Nivotrack(cfg); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Nivotrack(cfg, components); }
public IComponentCfg DefaultConfig() { return new NivotrackCfg(this.GetType().Namespace.Substring(17), this); }

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