Compare commits

...
Author SHA1 Message Date
Milan Hanajik b3f23db8dc Reconfigured for FEWA 50 2019-04-20 10:07:59 +02:00
Milan Hanajik cfb29c8149 DataEntry.Fewa.EntryForm added, ver. 2.18.1199 2019-04-20 10:07:31 +02:00
Milan Hanajik 960dc9d53a Output.SensusOracle.Database bug fix, as a consequence sometimes the IperlLogs were not written, ver. 2.18.1198 2019-04-19 11:18:49 +02:00
Milan Hanajik 03180392b0 IperlLogger : (1) Retv.Error handled properly, (2) more logging, ver. 2.18.1197 2019-04-18 11:23:19 +02:00
Milan Hanajik 03aa29cf75 SensusTestInfo for DEWA changed, ver. 2.18.1196 2019-04-18 09:35:40 +02:00
Milan Hanajik d724dab388 ver.2.18.1195 2019-04-15 16:20:55 +02:00
Milan Hanajik 208510921a DEWA : (1) Modification of SensusTestInfo, (2) Minor Q2 correction change, ver. 2.18.1194 2019-04-15 09:06:04 +02:00
Milan Hanajik 51d28fc5a9 ver. 2.18.1193 2019-04-15 08:20:24 +02:00
Milan Hanajik f8671ac516 (1) Range of flow extended to 125%, (2) RequredFlowLo/Hi etc. float -> double, ver. 2.18.1192 2019-04-15 08:15:47 +02:00
Milan Hanajik 556290abf6 DEWA300 double and tripple flowmeters, NominalFlow and LtrPerPulse are doubles, ver. 2.18.1191 2019-04-11 15:39:46 +02:00
Milan Hanajik e1e74e1588 IperlLogger fix (adjustment, negative PruefungsNrLog), etc., ver. 2.18.1189 2019-04-09 13:05:16 +02:00
Milan Hanajik fa7565e541 iPerlSpecial : MainWnd does not process num. keys, coax valve can be controlled manually, ver. 2.18.1188 2019-04-09 09:49:32 +02:00
Milan Hanajik 3c341d4d97 Test method sequences : Correct error message on flow setting timeout. 2019-04-08 10:34:12 +02:00
Milan Hanajik b8a16f1301 Q2 correction calculation and Q2CorrectionCheck activity modifications, ver. 2.18.1187 2019-04-08 09:44:13 +02:00
Milan Hanajik 33947e383f ver. 2.18.1186 2019-04-05 09:49:11 +02:00
Milan Hanajik 6a61c9400b Q2CorrectionCheck modified, ver. 2.18.1185 2019-04-05 09:04:44 +02:00
Milan Hanajik 32d560d164 SensusTestInfo fixes for repeatability and EMP, ver. 2.18.1184 2019-04-04 14:23:50 +02:00
Milan Hanajik 809b067260 Clean-up, Q2Corretion and Q2CorrectionDone removed from Results DB, ver.2.18.1183 2019-04-04 10:23:52 +02:00
Milan Hanajik b235f9ae20 (1) SUEZ cycle: InitOrReadQ2Correction, (Conditional)UpdateQ2Corrections, (2) Flow dir. detection fixed, (3) etc., ver. 2.18.1182 2019-04-03 16:19:46 +02:00
Milan Hanajik e356934ede ver. 2.18.1176 2019-03-28 09:17:33 +01:00
Milan Hanajik 2c4c76343d SensusOracle.Database and ProductionTracing.Tracing : CurrentOp => OpState with ...Scheduled and ...Running satates, ver. 2.18.1174 2019-03-22 11:21:06 +01:00
Milan Hanajik b8c4f35b1a 'completeTestInfo' reloaded when only the procedure changes (and not wmTypeID), usefull for iPerlSpecial, ver. 2.18.1174 2019-03-21 15:36:42 +01:00
Milan Hanajik c855a18c61 SensusTestInfo matching and its use in SensusOracle.Database and IperlLogger.Writer reimplemented, ver. 2.18.1173 2019-03-21 14:20:17 +01:00
Milan Hanajik d40f6a6c15 Output.DB.SensusOracle.Database : TestMode (no writes to DB). 2019-03-20 10:58:09 +01:00
Milan Hanajik a2bb50117e StartInfo is read from DB when previous results were reloaded. 2019-03-20 09:57:41 +01:00
Milan Hanajik 8624f30f71 IperlLogger bug fix, ver. 2.18.1172 2019-03-20 08:47:08 +01:00
Milan Hanajik 9fecf05b3f (1) ProcessTabPageEx: TRefHi, TRefLo (2) Ambient vals. written directly to ProcessData (3) Sequences changed:'readTempPressOps', ver. 2.18.1171 2019-03-20 08:25:01 +01:00
Milan Hanajik 0041ec9616 TURA_SEPCIAL uses ProcessTabPageExCtrl in MainWnd.Designer. 2019-03-20 08:23:03 +01:00
Milan Hanajik 77c26abc02 TBF.Screens.ProcessTabPageHeatMetersCtrl completed. 2019-03-17 12:29:04 +01:00
Milan Hanajik 0c964fdb5b ComponentsManagerDlg : Copying to subsequent cells via right-click implemented, ver. 2.18.1168 2019-03-16 10:19:57 +01:00
Milan Hanajik 84322476d6 SensusOracle and IperlLogger write only data of iPerls without any production issues. 2019-03-15 10:55:12 +01:00
Milan Hanajik f1278dd9a5 IperLogger : (1) Logging of TestInfo-s, (2) using (TextWriter logger = new ... ) { try {...} catch { } } construction. 2019-03-15 10:37:35 +01:00
Milan Hanajik e7164b98ff (1) TBF.Screens.ResultsTabPageCtrl fixes, (2) Results.Forms.BatchResultsDlg fixes : Show previous results displays colors, ver. 2.18.1167 2019-03-15 10:37:20 +01:00
Milan Hanajik 26d49eb4b7 DEWA300 component upgraded (13.3.2019), ver. 2.18.1165 2019-03-14 08:15:42 +01:00
Milan Hanajik b410f473e2 TempMeter zero-based index range extended to 0..15, ver. 2.18.1164 2019-03-13 09:39:10 +01:00
Milan Hanajik 3e54204a17 ResultsTabPageCtrl : iPerl is rejected also when proefindex==limit and it failed the test, ver. 2.18.1163 2019-03-13 08:50:43 +01:00
Milan Hanajik 70cba76ffd (1) iperl_check with Continue/Abort (2) MeterTestRslt.ErrorIndicators (not in DB) (3) ErrorFlags.Errors modif. (4) ResultsTabPage commonBackColor, etc. 2019-03-12 11:15:59 +01:00
Milan Hanajik d45c3f96d6 TBF : (1) flow setting timeout = 300 s = 5 min., (2) stable mass msrmnt. timeout = 300 s = 5 min., ver. 2.18.1162 2019-03-11 08:36:02 +01:00
Milan Hanajik 684fed8fc0 IDataEntry supports bool Completed property. 2019-03-08 10:20:58 +01:00
Milan Hanajik 99bb0cec57 LargeMessageBoxForm : (1) is red, (2) OK button is always visible, (3) auto scroll bar. 2019-03-08 10:20:57 +01:00
Milan Hanajik 263d990be4 Output.DB.ProductionTracing : Checking previous records at the beginning of the cycle. 2019-03-08 10:13:37 +01:00
Milan Hanajik 5f6c1fe70a Output.DB.SensusOracle cleaned up : CheckBarcodeScanningOp removed, ver. 2.18.1161 2019-03-08 07:24:51 +01:00
Milan Hanajik 2e76d595c0 Quido RS 4-4 support added, ver. 2.18.1160. 2019-03-06 10:45:58 +01:00
Milan Hanajik 75e5b75d4d DEWA_300 : (1) component upgraded (6.3.2019), (2) Diverter: flowMtrNr4Cmd fixed, ver. 2.18.1159 2019-03-06 09:42:25 +01:00
Milan Hanajik b47f5e32d4 DEWA_300 symbol usage fixed, ver. 2.18.1158 2019-03-05 15:12:24 +01:00
Milan Hanajik 771af696ae (1) TBF program shutdown modifications, (2) Obligatory tank draining before TBF exit, (3) Shutdown PC after TBF exit option, ver. 2.18.1156 2019-03-05 12:28:58 +01:00
Milan Hanajik b10ab44fa9 (1) MetrologyDlg displays corrections for all pressure meters, (2) Elde.PressureMeter and Modbus.PressureMeter.Meret use corrections. 2019-03-04 09:20:16 +01:00
Milan Hanajik 13eb7138a3 TracingDB : Cleaned-up and upgraded to current version, TBF : Workplace registered for approx. 2 weeks. 2019-03-01 14:16:04 +01:00
Milan Hanajik 02f6c9264a MID Statistics is data driven, no MidId enum, ver. 2.18.1154 2019-02-28 15:13:44 +01:00
Milan Hanajik edb26ccf6e ver. 2.18.1154 2019-02-28 10:03:52 +01:00
Milan Hanajik 2574ce1aee ver. 2.18.1153 2019-02-27 08:11:50 +01:00
Milan Hanajik 5586f58c6e iPerlCommunicationForm : Better try/catch, more logging, ver. 2.18.1152 2019-02-25 16:15:41 +01:00
Milan Hanajik 138e436645 (1) DEWA_300 component added, (2) DEWA_300 symbol added, (3) IZRAEL_200 symbol bug fix, ver. 2.18.1151 2019-02-25 12:49:04 +01:00
Milan Hanajik ea7e727798 (1) Modbus.QuidoRS.ConfirmationForm added, (2) Use of QuidoRS in iPerlCommForm fixed - uses QuidoRS.Variant, ver. 2.18.1149 2019-02-25 11:05:21 +01:00
Milan Hanajik 7a40cfb1f2 More logging in ShowBenchWaitingOp and ShowBenchErrorOp. 2019-02-22 12:48:51 +01:00
Milan Hanajik b2226ad779 iPerlCommunication : TestModeConfig value verified after switching to a test mode. 2019-02-21 16:00:01 +01:00
Milan Hanajik ebf96f655c Output.DB.SaveFlowmeterCorrections : Corrections calculated differently, from FlowVolume, not FlowMean. 2019-02-20 15:11:58 +01:00
Milan Hanajik 4134bf8875 ProcessTabPageHeatMetersCtrl modifications, language resources, etc. 2019-02-20 14:21:18 +01:00
Milan Hanajik fd7149e263 Screens.ProcessTabPageHeatmetersCtrl added, ver. 2.18.1148 2019-02-20 11:35:57 +01:00
Milan Hanajik a40b4ff606 Added: (1) IParallelOutput, (2) StateMachine.BenchWaitingOp/BenchErrorOp, (3) Modbus.QuidoRS support for Quido RS 8/8 (4) etc., ver. 2.18.1147 2019-02-20 08:34:03 +01:00
Milan Hanajik 86c063caee ReasultsBrowser : Histograms added, ver. 2.18.1146 2019-02-19 14:42:46 +01:00
Milan Hanajik bea3c04eb7 Output.DB.SensusOracle.Database : Writing results more robust, preventing program crash. 2019-02-18 09:04:00 +01:00
Milan Hanajik c5644d6999 iPerlCommunication cleanup, ver. 2.18.1144 2019-02-15 15:36:08 +01:00
Milan Hanajik 29c4c869f2 iPerlCommunication 'iPerlCheck' fixed : Writes correct WMPositions (not wmNr0), ver. 2.18.1143 2019-02-14 08:16:16 +01:00
Milan Hanajik 707c093f0c Heat meter results, ver. 2.18.1142 2019-02-13 15:39:44 +01:00
Milan Hanajik abaf756980 (1) Reading Q2 corrections form iPerl fixed (was unsigned), (2) Displaying ProdQ2CorrRL/LR fixed, ver. 2.18.1141 2019-02-13 13:12:52 +01:00
Milan Hanajik 32873ee2b0 (1) Auto. wmTypeRev (2) IperlCheck t.meth. (3) Pruefindex, Q2corr. read from Ora.on start (4) VolStart/VolEnd written to Ora. bounded, (5) iPerlCommForm.ReadQ2Corr() bug fix (6) LU logging cleanup, etc, ver. 2.18.1140 2019-02-13 09:27:22 +01:00
Milan Hanajik dd8273798a TestMethod.Adjustment : Bug fix for the case Publish==Never (Izrael) 2019-02-06 14:05:49 +01:00
Milan Hanajik 0dae18e5e8 Output.DB.SensusOracle cleanup. 2019-02-05 14:13:37 +01:00
Milan Hanajik 17063518ce Bug fix : Saving to Oracle failed due to large VolumeStart/VolumeEnd values, ver. 2.18.1131 2019-02-05 12:36:17 +01:00
Milan Hanajik a4998521f5 ver. 2.18.1131 2019-02-05 12:20:38 +01:00
Milan Hanajik d2df1a678f (1) Writing both Q2 corr. factors fixed, (2) Q2 corr. factors for std. R800 meters calculated differently, (3) Writing WMPosition to iPerlLog, (4) OptoTelegram start/end label. 2019-02-04 13:55:13 +01:00
Milan Hanajik f6aa6ba2d6 ResultsTabPage layout modifications 2019-01-30 15:38:51 +01:00
Milan Hanajik 82743bac05 Results : TestPartStr item added, ver. 2.18.1127 2019-01-30 15:35:25 +01:00
Milan Hanajik 30df663634 iPerlSpecial : Bug fixes in results DB changes, reading from Oracle and new result items, ver. 2.18.1126 2019-01-30 10:14:24 +01:00
Milan Hanajik f8ac27ba3c iPerl : (1) results DB change, (2) reading from Oracle on cycle start, (3) reading Q2 corr. factors from iPerl, (4) new result items, (5) MainSeq cleanup, ver. 2.18.1125 2019-01-29 16:05:29 +01:00
Milan Hanajik 88496cf003 Calculated error limits for heat meters, change in flow calculation, for Kepno PT50, etc. 2019-01-25 16:39:16 +01:00
Milan Hanajik 4e2c4c3bac TBF : (1) SharedButtons: opt. buttons positions automated, (2) Export and import of transition sequences, ver. 2.18.1122 2019-01-25 13:22:05 +01:00
Milan Hanajik 9bed5e6682 Ambient cleanup, ver. 2.18.1120 2019-01-23 08:26:53 +01:00
Milan Hanajik c6e1d672e5 TBF : Saving positions of maximized or minimized forms fixed, ver. 2.18.1119 2019-01-22 20:28:13 +01:00
Milan Hanajik 8b2d01a5ac TBF : 'Previous' / 'Next' buttons in PreviousResultsDlg, ver. 2.18.1118 2019-01-22 15:50:37 +01:00
Milan Hanajik 2037f8bbe7 ver. 2.18.1116 2019-01-17 14:42:41 +02:00
Milan Hanajik 772cfc8e29 TBF : KPackE.Radio, KPackE.DataEntryForRadio, KPackE.RegisterReader and IReceivesDataFromRadio added, ver. 2.18.1115 2019-01-17 14:39:10 +02:00
Milan Hanajik 1eebb3b4a1 ResultsBrowser : Searching for a list of water meters added, ver. 2.18 1115 2019-01-17 09:15:24 +02:00
Milan Hanajik 550fe20094 Izrael PT200 component upgraded (17.01.2019) : Fixes in regulation valves and a coax, ver. 2.18.1114 2019-01-17 09:15:03 +02:00
Milan Hanajik 25e6a04a98 ver. 2.18.1113 2019-01-16 11:11:04 +02:00
Milan Hanajik ab8f550bb3 DataEntry.Single added. 2019-01-16 10:55:30 +02:00
Milan Hanajik c59d2cf52c DataEntry forms modified: Magnified text shown, Standard24 is finished and well tested, ver. 2.18.1112 2019-01-16 10:55:21 +02:00
Milan Hanajik 23c9fadf86 (1) Elde.ControlComWrap modified for IZRAEL_200, (2) DB upgrade deals with FixedStartCombinedMeters component, ver. 2.18.1111 2019-01-15 11:40:43 +02:00
Milan Hanajik f5926259a7 Config.Entities.Test : Support for tests using multiple (but not all) lines (Israel PT50, 4 lines). 2019-01-14 15:33:36 +02:00
Milan Hanajik f180af692f DataEntry.Standard#.TestStartEndForm disabled text boxes for meters where the related register reader == null, ver. 2.18.1110 2019-01-14 13:24:34 +02:00
Milan Hanajik d3ca871eb5 Output.Printers.Label.Printer re-implemented using a configurable list of items, ver. 2.18.1109 2019-01-13 16:34:38 +02:00
Milan Hanajik 58f046ca34 ResultsBrowser : Batch number filter added, ver. 2.18.1110 2019-01-11 18:05:12 +01:00
Milan Hanajik e1c4da482a ResultsBrowser : (1) benches supported, (2) Configuration in user\AppData\Local\ResultsBrowser, ver. 2.18.1109 2019-01-11 14:25:53 +01:00
Milan Hanajik b7a079515c TBF : (1) SensusOracle.Database implements IStartInfoReader, (2) MainSeq invokes ReadStartInfoOp of result writers that implement IStartInfoReader. 2019-01-11 10:37:29 +01:00
Milan Hanajik 5849984381 Statistics : (1) LocalSettings folder is optional, (2) LocalSettings changes, (3) New conn. strings/IP addr., (4) Flow ranges saved. 2019-01-09 10:04:44 +01:00
Milan Hanajik a75a7d0a4a IPERL : Component updated (8.1.2019), temperature displayed with 2 decimal digits. 2019-01-08 10:44:52 +01:00
Milan Hanajik 4fa2159e61 ResultsBrowser: WM Position filter added, ver. 2.18.1108 2019-01-08 10:44:51 +01:00
Milan Hanajik 3f3a01857b iPerlHead : FLow filtering by FIRFilterFlow() corrected, ver. 2.18.1109 2018-12-31 23:11:17 +01:00
Milan Hanajik c37f15bae2 iPerlHead : Full opto data buffer length, ver. 2.18.1108 2018-12-21 09:47:45 +01:00
Milan Hanajik 2bce044cba (1) iPerlHead bug fix : Support for very long tests exceeding optodata buffer size, (2) Berlin fixes (IScaleOrTank), ver. 2.18.1107 2018-12-21 09:35:37 +01:00
Milan Hanajik 1937850814 Statistics : 5 flow ranges and charts. 2018-12-21 08:14:42 +01:00
Milan Hanajik 1703c5dcc2 Test start for 'Fixed start/stop method' modified, ver. 2.18.106 2018-12-19 14:41:16 +01:00
Milan Hanajik 6b803444f0 Statistics : First working version, ver. 2.18.1104 2018-12-19 12:24:37 +01:00
Milan Hanajik 76042756b1 (1) Verification whether Div ThresholdHI is greater then ThresholdLO, (2) Fixed a bug when no graph was selected and layout mode was changed. 2018-12-18 13:58:09 +01:00
Milan Hanajik 2f3f67c82e IPerlHead : more logging when saving opto data, ver. 2.18.1103 2018-12-18 12:37:49 +01:00
Milan Hanajik 97c041801f PressureMeter : Protocol selection in component properties (Meret, Modbus), ver. 2.18.1102 2018-12-18 10:28:34 +01:00
Milan Hanajik 7d968ba9b4 Izrael25 : Regulation valve ADC numbers, ver. 2.18.1101 2018-12-18 07:42:21 +01:00
Milan Hanajik d3cd831e03 iPerlHead : Support for very long tests exceeding optodata buffer size, ver. 2.18.1099 2018-12-17 14:13:21 +01:00
Milan Hanajik 20b2b9da97 (1) ResultsBrowser : Import of printer configuration, (2) DataEntry.Combined.CycleBeginningForm with Remark, ver. 2.18.1098 2018-12-14 16:47:32 +01:00
Milan Hanajik 55aff104ae (1) ResultsBrowser ver. 2.18.1096, (2) Reload previous results button shown always, translated to German. 2018-12-14 14:00:15 +01:00
Milan Hanajik 9ba3fd34d3 Handling of error conditions in ProcedureDlg (e.g. when sensors are changed and user changes parameters without reopening), ver. 2.18.1096 2018-12-14 11:40:59 +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
Milan Hanajik 19d77a9ad9 SENTEC : FlyingStartMassCollectionSeq : Tank draining is completed before the flow control starts (as in Berlin). 2018-09-28 14:16:12 +02:00
Milan Hanajik e77c0460de UltrasoundLevelMeter parent name is 'Modbus' only. 2018-09-27 15:20:34 +02:00
Milan Hanajik 2ad5843f4f Cleanup: bool Output.SensusTestInfo.AreCompatible(.,. ) introduced, etc, ver. 2.18.1008 2018-09-27 15:02:36 +02:00
Milan Hanajik 631ef5fe20 SensusOracle.Database : Bug fix in TestInfo comparison, Qbz. Just == Just1 allowed now, ver. 2.18.1007 2018-09-25 16:36:43 +02:00
Milan Hanajik cd246e89c8 RequiredGroupMembership: Users.Grp.GID --> Users.Grp.GID[] (initial version), ver. 2.18.1006 2018-09-25 09:05:51 +02:00
Milan Hanajik 438374532f BatchResults.IsProduction( ) modified, ver. 2.18.1005 2018-09-24 13:06:01 +02:00
Milan Hanajik 92609b9ead iPerl CalibrationStructV4 related stuff added, ver. 2.18.1004 2018-09-24 10:06:19 +02:00
Milan Hanajik 07b51f12a2 Prevent SW crash in bool Results.Output.Printers.Table.IsEmpty( ) 2018-09-20 12:23:24 +02:00
Milan Hanajik 16494389c6 ver. 2.18.1001 2018-09-20 08:24:05 +02:00
Milan Hanajik be86f0278f FEWA_50 component added, FEWA_50 define processing added, ver. 2.18.1000 2018-09-19 12:17:38 +02:00
Milan Hanajik 7e7ae86f65 iPerlHead : 'LogType' procedure parameter added and used when creating 'optoDataLogFileName'. 2018-09-19 11:14:10 +02:00
Milan Hanajik 3b2139d3df (1) Output.FileWriters.IperlLogger uses definitions stored in Output.SensusTestInfo objects, (2) sensusOracle.Database OK for Suez, searches for appropriate SensusTestInfo-s. 2018-09-19 11:10:48 +02:00
Milan Hanajik 16c59b5c47 (1) MessageBoxOp, AskYesNoOp and CoverTest do not use Bridge.OnCloseQandAForm, (2) ChangeOfFlowDirection --> ChangeFlowDirection, (3) code cleanup, 2018-09-18 16:44:32 +02:00
Milan Hanajik 49cc584914 (1) Closing iPerlCommunicationForm fixed once again, (2) Czech translations fixed. 2018-09-18 15:24:33 +02:00
Milan Hanajik aeefac1d4e iPerlCommunication activity "Write Q2 correction R-L" and "Write Q2 correction L-R" added, ver. 2.18.999 2018-09-17 14:16:40 +02:00
Milan Hanajik 2b30607d9c ver. 2.18.998 2018-09-17 12:46:11 +02:00
Milan Hanajik cef8d3ff95 Stubs of Hart.Common and Hart.Nivotrack components added. 2018-09-14 12:13:15 +02:00
Milan Hanajik 64646486e9 All DataEntry forms bug fix : PurchaseOrder of water meters is updated only when a form was closed by OK, ver. 2.18.997 2018-09-14 09:52:11 +02:00
Milan Hanajik 769e68d49b Output.Printers.Enhanced : "Nr. of copies' option added, ver. 2.18.996 2018-09-14 09:02:21 +02:00
Milan Hanajik 3dcb134aa1 Output.Printers.Enhanced : 'Good only' option fixed. 2018-09-14 08:27:12 +02:00
Milan Hanajik 81cb0eae64 Results.ItemID : Procedure_description, Test_bench_name, Address1-5 and respective WMeterRsltItemSpec added, ver. 2.18.995 2018-09-14 08:25:22 +02:00
Milan Hanajik 4fad9925ec ResultsBrowser: CEVAK specific code commented out, ver. 2.18.995 2018-09-13 17:56:02 +02:00
Milan Hanajik 92d246eda0 TBF : Processing keys in MainWnd disabled for CEVAK_200 2018-09-13 17:54:03 +02:00
Milan Hanajik 34479778b9 CEVAK_40, FUZHOU_50/_100/_150/_300, MURES_40, PUCHONG_200, TORINO_50, TORUN_50 introduced, ver. 2.18.995 2018-09-13 14:17:03 +02:00
Milan Hanajik 163d209071 TBF bug fixes : (1) RegulValve adcChannel for CEVAK, (2) ComponentsManagerDlg columns. 2018-09-13 12:49:31 +02:00
Milan Hanajik 8eb601f24d UltrasoundLevelMeter component added. 2018-09-13 12:48:09 +02:00
Milan Hanajik ac9407b59d TestMethods.PulsesTestManual added, ver. 2.18.994 2018-09-13 09:02:24 +02:00
Milan Hanajik 00dd0ed8fd Output.FileWriters.IperlLogger modifications : LogType.DEWA added. 2018-09-12 13:30:39 +02:00
Milan Hanajik 6a53417b62 TBF : (1) SensusOracle component moved from DB to Output.DB, (2) Output.SensusCommon class, (3) Output.SensusTestInfo class. 2018-09-11 14:03:05 +02:00
Milan Hanajik 90f2b83fc0 iPerlCommunicationForm : Fixed closing the form when editing check boxes. 2018-09-11 11:31:00 +02:00
Milan Hanajik 3382c6e77a (1) Output.FileWriters.IperlLogger configuration for LogType.Suez, (2) DB.SensusOracle Quality DB + dead code/parameters cleanup, ver. 2.18.993 2018-09-11 11:30:08 +02:00
Milan Hanajik 072de642e1 ComponentsManagerDlg : Components sorting controlled by click-able column headers. 2018-09-10 12:28:53 +02:00
Milan Hanajik 489ebd04aa TestMethods.ChangeOfFlowDirection added. 2018-09-10 10:06:31 +02:00
Milan Hanajik 2a68934b0e More logging in all Output.FileWriters, ver. 2.18.992 2018-09-07 12:40:32 +02:00
Milan Hanajik f3a502b7df iPerlCommunicationForm : minimizing, maximizing and closing this form is disabled, ver. 2.18.992 2018-09-07 10:18:32 +02:00
Milan Hanajik 2b0e66c71d MessageBoxOp : Form has a windows title so that it can be moved. 2018-09-06 17:16:22 +02:00
Milan Hanajik e5c01a14d9 Bug fix in last graphs batch numbers. 2018-09-06 16:52:11 +02:00
Milan Hanajik e5ef10beac Bug fix in ErrorFlags evaluation. 2018-09-06 15:49:10 +02:00
Milan Hanajik 4c3c499ad5 Output.FileWriters.IperlLogger component added (generalized, loop over tests), ver. 2.18.990 2018-09-06 15:48:39 +02:00
Milan Hanajik bdc7f5abd8 RoiDetectionSeq : More logging (display) 2018-09-06 15:25:48 +02:00
Milan Hanajik 0ff78b9d4c (1) Multiple instances of SensusOracle.Database component possible, (2) Test.ItemNr updated properly, ver. 2.18.988 2018-09-04 13:48:50 +02:00
Milan Hanajik 41959d863f Changes for CEVAK PT200, ver. 2.18.986 2018-09-03 08:28:45 +02:00
Milan Hanajik e7d495e47d ver. 2.18.985 2018-08-31 14:16:08 +02:00
Milan Hanajik e4f5be3f41 iPerlCommunication : (1) Bug fix for iPerlSpecial, (2) Save button position, (3) Activity is a ComboBox, (4) DN is a ComboBox, ver. 2.18.984 2018-08-31 12:46:12 +02:00
Milan Hanajik f42c1b7f0c CEVAK PT200 component upgraded (initial version dated 30.08.2018). 2018-08-30 14:13:31 +02:00
Milan Hanajik 9dbca87429 Copying users from a remote database fixed (UI) and done as a database transaction, ver. 2.18.982 2018-08-30 14:11:40 +02:00
Milan Hanajik 49ae2a84c4 Remote DB : (1) Bug fix in DatabaseSettings.Clone(), (2) Compatibility check on startup. 2018-08-30 14:10:20 +02:00
Milan Hanajik 34073844bc Config.FluentCommon cleanup : SaveToDb( ) and DeleteFromDb( ) removed. 2018-08-30 08:04:19 +02:00
Milan Hanajik 6f3b9be77e TBF : LoginDlg displayed after a double-click on the status strip with current user name. 2018-08-28 13:11:55 +02:00
Milan Hanajik f675c7ada2 Output.DB.ProductionTracing.TracingDB : Workplace registration. 2018-08-28 13:10:31 +02:00
Milan Hanajik 6aee0a71ed TBF : Output.DB.ProductionMonitoring --> Output.DB.ProductionTracing. 2018-08-28 10:12:39 +02:00
Milan Hanajik fa818c5cf8 TracingDB : WorkplaceRegistration, etc. added, TrivialLoginDlg removed, ver. 1.5.61 --> 2.0.65 2018-08-28 09:58:58 +02:00
Milan Hanajik 0ef9505af1 MonitoringDB --> TracingDB, TBF ver. 2.18.981 2018-08-28 09:44:39 +02:00
Milan Hanajik bf69524fd8 TBF : (1) Elde.RegisterReader has a new proc. parameter int Filter, (2) Filters 'int[]' are passed everywhere in the TBF application istead of test.TolerRed. 2018-08-23 12:45:13 +02:00
Milan Hanajik 58df07300e TestMethods.GenesisHead and TestMethods.GenHead folders added. 2018-08-22 18:48:37 +02:00
Milan Hanajik bef4928162 Genesis : (1) component upgraded (dated 22.08.18), (2) bug fixes, ver. 2.18.980
more
2018-08-22 18:46:17 +02:00
Milan Hanajik 5995204d8d ver. 2.18.979 2018-08-22 08:36:32 +02:00
Milan Hanajik 69b7c94176 Users.Forms.UserManagementDlg : Sorting by data in columns including a surname, ver. 2.18.981 2018-08-14 14:37:15 +02:00
Milan Hanajik 540bc8ca74 ver. 2.18.979 2018-08-08 11:34:17 +02:00
Milan Hanajik 03920d5b90 ver. 2.18.978 2018-08-06 15:59:58 +02:00
Milan Hanajik 765637ce2d TestMethods.PulsesTest : (1) Fixes in forms, (2) MinPulsesCount test parameter introduced, ver. 2.18.977 2018-08-03 11:16:13 +02:00
Milan Hanajik b4596ae6e9 User.Grp.GID.TracabilityManagement user level added for TYRA_IPERL only. 2018-08-03 08:08:14 +02:00
Milan Hanajik 4c92cb7af0 MonitoringDB merged with ProductionTracing, ver. 1.5.61 2018-08-02 13:41:10 +02:00
Milan Hanajik 770b8447ac Default connection string for central DB of users updated. 2018-08-02 13:41:09 +02:00
Milan Hanajik f3532fc3cb Unnecessary references removed, ver. 2.18.976 2018-07-30 09:31:45 +02:00
Milan Hanajik a7cfbc0b76 Fuzhou 100 component updated : Initial version dated 25.07.2018 2018-07-25 15:13:56 +02:00
Milan Hanajik 608dd087b8 Sequences.Statistics.ApplyFilter() cleanup, ver. 2.18.975 2018-07-23 16:02:02 +02:00
Milan Hanajik 5d2871b9ed PulsesTest : Puses count = '---' and rectangles are red on startup. 2018-07-19 17:29:43 +02:00
Milan Hanajik 779c870613 Comparison (VolumeMaster == 0) done when calculating Constmaster in all mass based methods, ver. 2.18.972 2018-07-19 13:20:48 +02:00
Milan Hanajik 3cd585fe41 Modbus.CometAmbient.Ambient comments only. 2018-07-19 11:03:28 +02:00
Milan Hanajik ff27ae7635 ver. 2.18.971 2018-07-18 17:43:17 +02:00
Milan Hanajik a41e805e8d DUBAJ_50 and CEVAK_200 added, ver. 2.18.970 2018-07-18 17:27:42 +02:00
Milan Hanajik 9bcf3aa7f6 TestMethods.PulsesTest : Texts in forms fixed. 2018-07-18 16:31:55 +02:00
Milan Hanajik ff2248720c TestMethods.PulsesTest added. 2018-07-18 10:00:37 +02:00
Milan Hanajik 9bd2cd2634 Error message after a wrong test or procedure parameter, ver. 2.18.969 2018-07-17 12:16:52 +02:00
Milan Hanajik 9ba1b58d2e CombinedWithDetTestParams.OffsetPulsesFreq parameter introduced, use in Qfall detection, ver. 2.18.968 2018-07-17 10:53:34 +02:00
Milan Hanajik 1d8728c7ce TURA_SPECIAL : 'Stop draining' in BenchControlPanel is not protected by a password, ver. 2.18.967 2018-07-16 15:56:03 +02:00
Milan Hanajik af68f35400 (1) ComponentsManagerDlg displays all components that failed to load, (2) Diverter.divNrFromName fixed for Berlin (DivEx), ver. 2.18.966 2018-07-16 15:05:06 +02:00
700 changed files with 82710 additions and 16394 deletions
+2
View File
@@ -0,0 +1,2 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
+4 -2
View File
@@ -8,12 +8,14 @@ GemCard/bin
GemCard/obj
GraphLib/bin
GraphLib/obj
MonitoringDB/bin
MonitoringDB/obj
TracingDB/bin
TracingDB/obj
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;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;FEWA_50</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;MUNICH</DefineConstants>
<DefineConstants>TRACE;FEWA_50</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" />
+17 -5
View File
@@ -14,31 +14,43 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200 || DEWA_300
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif FUZHOU100
#elif DUBAJ_50
public const int WMsCount = 10;
public const int LineSize = 5;
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;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
#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;
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Config
result.IsRealBench = IsRealBench;
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
result.UsersDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
result.UsersDBSettings = (Users.DBSettings)UsersDBSettings.Clone();
return result;
}
+81 -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>
@@ -224,6 +224,14 @@ namespace Config.Entities
Count
}
public enum MeretProtocol
{
[Description("<undefined>")] Undefined,
[Description("Meret (obsolete)")] Meret,
[Description("Modbus")] Modbus,
Count
}
public enum Publish : sbyte
{
#if LANG_DE
@@ -490,4 +498,75 @@ namespace Config.Entities
#endif
Count
}
public enum ErrorFlagShift
{
E1 = 0,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
E11,
E12,
E13,
E14,
E15,
E16,
E17,
E18,
E19,
E20,
E21,
E22,
E23,
E24,
E25,
E26,
E27,
E28,
E29,
E30,
E31,
}
public enum ErrorFlagMask
{
E1 = (1 << (int)ErrorFlagShift.E1),
E2 = (1 << (int)ErrorFlagShift.E2),
E3 = (1 << (int)ErrorFlagShift.E3),
E4 = (1 << (int)ErrorFlagShift.E4),
E5 = (1 << (int)ErrorFlagShift.E5),
E6 = (1 << (int)ErrorFlagShift.E6),
E7 = (1 << (int)ErrorFlagShift.E7),
E8 = (1 << (int)ErrorFlagShift.E8),
E9 = (1 << (int)ErrorFlagShift.E9),
E10 = (1 << (int)ErrorFlagShift.E10),
E11 = (1 << (int)ErrorFlagShift.E11),
E12 = (1 << (int)ErrorFlagShift.E12),
E13 = (1 << (int)ErrorFlagShift.E13),
E14 = (1 << (int)ErrorFlagShift.E14),
E15 = (1 << (int)ErrorFlagShift.E15),
E16 = (1 << (int)ErrorFlagShift.E16),
E17 = (1 << (int)ErrorFlagShift.E17),
E18 = (1 << (int)ErrorFlagShift.E18),
E19 = (1 << (int)ErrorFlagShift.E19),
E20 = (1 << (int)ErrorFlagShift.E20),
E21 = (1 << (int)ErrorFlagShift.E21),
E22 = (1 << (int)ErrorFlagShift.E22),
E23 = (1 << (int)ErrorFlagShift.E23),
E24 = (1 << (int)ErrorFlagShift.E24),
E25 = (1 << (int)ErrorFlagShift.E25),
E26 = (1 << (int)ErrorFlagShift.E26),
E27 = (1 << (int)ErrorFlagShift.E27),
E28 = (1 << (int)ErrorFlagShift.E28),
E29 = (1 << (int)ErrorFlagShift.E29),
E30 = (1 << (int)ErrorFlagShift.E30),
E31 = (1 << (int)ErrorFlagShift.E31),
}
}
+5 -1
View File
@@ -60,7 +60,11 @@ namespace Config.Entities
/// <param name="strValue">String representation of the parameter</param>
CfgUpdateFlags UpdateParam(int ix, string strValue);
void UpdateEmbeddedDbEntity();
/// <summary>
/// Updates DB entities for related parameters
/// </summary>
/// <returns>true when successful</returns>
bool UpdateEmbeddedDbEntity();
/// <summary>
/// Creates an object copy
+44
View File
@@ -0,0 +1,44 @@
///
/// 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 Counting
{
Arbitrary,
Positive,
Negative,
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;
}
}
}
+50 -16
View File
@@ -25,8 +25,8 @@ namespace Config.Entities
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) or 1=class1, 2=class2, 3=class3
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) or -Qn in m3/h
public virtual float ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual float ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual int Repeats { get; set; }
public virtual bool DoDraining { get; set; }
@@ -310,54 +310,88 @@ namespace Config.Entities
return null;
}
public virtual float GetErrLimLo(float flow)
public virtual double GetErrLimLo(double volumeCTV, double testTime)
{
if (ErrLimLo <= ErrLimHi)
{
return ErrLimLo; /// Error limit of a water meter
return ErrLimLo; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(ErrLimLo);
float Qp = Math.Abs(ErrLimHi);
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
double Qp = Math.Abs(ErrLimHi);
double Q = (testTime == 0) ? 1 : Math.Max(3.6 * volumeCTV / testTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
case 2: return -Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
case 3: return -Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
case 1: return -Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return -Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return -Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual float GetErrLimHi(float flow)
public virtual double GetErrLimHi(double volumeCTV, double testTime)
{
if (ErrLimLo <= ErrLimHi)
{
return ErrLimHi; /// Error limit of a water meter
return ErrLimHi; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(ErrLimLo);
float Qp = Math.Abs(ErrLimHi);
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
double Qp = Math.Abs(ErrLimHi);
double Q = (testTime == 0) ? 1 : Math.Max(3.6 * volumeCTV / testTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
case 2: return +Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
case 3: return +Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
case 1: return +Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return +Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return +Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual bool IsPartCompatible(int waterMeterPartNr)
{
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
if ((this.Part % 10) == waterMeterPartNr) return true;
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
return false;
}
/// <summary>
/// Determines whether tests part number is OK.
/// Examples of correct part number are:
/// 1, 2, 12, 21 in case of max. part nr.== 2
/// 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234 in case of max. part nr.== 4
/// </summary>
/// <param name="partNr">Tests par tnumber</param>
/// <returns>true when Part number is OK</returns>
public static bool IsGoodPartNr(int partNr)
{
bool firstDigitIsOK = ((partNr % 10) > 0) && ((partNr % 10) <= Config.Data.MaxPartNr);
bool secondDigitIsOK = (((partNr/10) % 10) > 0) && (((partNr/10) % 10) <= Config.Data.MaxPartNr);
bool thirdDigitIsOK = (((partNr/100) % 10) > 0) && (((partNr/100) % 10) <= Config.Data.MaxPartNr);
bool fourthDigitIsOK = (((partNr/1000) % 10) > 0) && (((partNr/1000) % 10) <= Config.Data.MaxPartNr);
if (firstDigitIsOK && (partNr / 10 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && (partNr / 100 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && (partNr / 1000 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && fourthDigitIsOK && (partNr / 10000 == 0)) return true;
return false;
}
public override string ToString()
{
+56 -2
View File
@@ -1,7 +1,10 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
@@ -37,5 +40,56 @@ namespace Config.Entities
foreach (var step in TransitionSteps) { result.TransitionSteps.Add(step.Clone()); }
return result;
}
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(ItemNr.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Name);
output.WriteLine(Description);
foreach (var step in TransitionSteps) { step.Export(output); }
output.WriteLine();
output.Close();
}
public static TransitionSequence Import(StreamReader input)
{
TransitionSequence result = new TransitionSequence();
result.ItemNr = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.Name = input.ReadLine();
result.Description = input.ReadLine();
while (true)
{
TransitionStep step = TransitionStep.Import(input, result);
if (step == null)
break;
else
result.TransitionSteps.Add(step);
}
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
const string fmt = "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
ln = inp.ReadLine(); /// skip ItemNr
ln = inp.ReadLine(); if (ln != Name) { diff.AppendFormat(fmt, "Name", Name, ln); };
ln = inp.ReadLine(); if (ln != Description) { diff.AppendFormat(fmt, "Description", Description, ln); };
//foreach (var step in TransitionSteps)
//{
// string testDiff = step.Compare(inp);
// if (testDiff.Contains(
//}
return diff.ToString();
}
}
}
+62 -1
View File
@@ -1,8 +1,10 @@
///
/// Copyright (c) 2013-2015, 2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
@@ -61,5 +63,64 @@ namespace Config.Entities
result += indent + "PumpsWithFMPct = " + PumpWithFMPcts + Environment.NewLine;
return result;
}
public virtual void Export(StreamWriter output)
{
CultureInfo ci = CultureInfo.InvariantCulture;
output.WriteLine(ItemNr.ToString(ci));
output.WriteLine(Duration.ToString(ci));
output.WriteLine(Message);
output.WriteLine(EndCondition);
output.WriteLine(ValvesOpen);
output.WriteLine(ValvesClose);
output.WriteLine(RegulValvesPct);
output.WriteLine(PumpWithFMPcts);
}
public static TransitionStep Import(StreamReader input, TransitionSequence newSequence)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine))
{
return null;
}
CultureInfo ci = CultureInfo.InvariantCulture;
int itemNr = int.Parse(firstLine, ci);
TransitionStep tst = new TransitionStep(itemNr, newSequence);
tst.Duration = int.Parse(input.ReadLine(), ci);
tst.Message = input.ReadLine();
tst.EndCondition = input.ReadLine();
tst.ValvesOpen = input.ReadLine();
tst.ValvesClose = input.ReadLine();
tst.RegulValvesPct = input.ReadLine();
tst.PumpWithFMPcts = input.ReadLine();
return tst;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
string fmt = string.Format("Step {0} : ", ItemNr) + "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
CultureInfo ci = CultureInfo.InvariantCulture;
string firstLine = inp.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return string.Format("TransitionStep {0} is missing in the compared file\r\n", ItemNr);
if (ItemNr.ToString() != firstLine) { diff.AppendFormat(fmt, "ItemNr", ItemNr, firstLine); };
ln = inp.ReadLine(); if (ln != Duration.ToString(ci)) { diff.AppendFormat(fmt, "Duration", Duration.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Message) { diff.AppendFormat(fmt, "Message", Message, ln); };
ln = inp.ReadLine(); if (ln != EndCondition) { diff.AppendFormat(fmt, "EndCondition", EndCondition, ln); };
ln = inp.ReadLine(); if (ln != ValvesOpen) { diff.AppendFormat(fmt, "ValvesOpen", ValvesOpen, ln); };
ln = inp.ReadLine(); if (ln != ValvesClose) { diff.AppendFormat(fmt, "ValvesClose", ValvesClose, ln); };
ln = inp.ReadLine(); if (ln != RegulValvesPct) { diff.AppendFormat(fmt, "RegulValvesPct", RegulValvesPct, ln); };
ln = inp.ReadLine(); if (ln != PumpWithFMPcts) { diff.AppendFormat(fmt, "PumpWithFMPcts", PumpWithFMPcts, ln); };
return diff.ToString();
}
}
}
+21 -1
View File
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
namespace Config.Entities
{
@@ -35,5 +36,24 @@ namespace Config.Entities
foreach (var step in VirtualBenchSteps) { result.VirtualBenchSteps.Add(step.Clone()); }
return result;
}
public virtual void Export(StreamWriter output)
{
/// TODO
}
public static VirtualBenchSequence Import(StreamReader input)
{
VirtualBenchSequence result = new VirtualBenchSequence();
/// TODO
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
/// TODO
return diff.ToString();
}
}
}
+1 -61
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@@ -127,41 +127,6 @@ namespace Config
return SessionFactories[ix].OpenSession();
}
public static void SaveToDb(Users.Entities.DBKind database, object obj)
{
SaveToDb(CreateSession(database), obj);
}
public static void SaveToDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
try
{
session.SaveOrUpdate(obj);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
}
}
public static void DeleteFromDb(Users.Entities.DBKind database, object obj)
{
DeleteFromDb(CreateSession(database), obj);
}
public static void DeleteFromDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
session.Delete(obj);
transaction.Commit();
}
}
/// <summary>
/// Create an empty users database.
/// Database contains only the user 'admin' and the control board component 'CB'.
@@ -218,30 +183,5 @@ namespace Config
return true;
}
/// <summary>
/// Create an empty water meters database
/// </summary>
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
/// <param name="connectionString">Connection string</param>
/// <returns>true=success, false=error</returns>
public static bool CreateEmptyResultsDB(Users.Entities.DBType dbType, string connectionString)
{
ISessionFactory sessionFactory = CreateSessionFactory(Users.Entities.DBKind.Results, dbType, connectionString, true);
if (sessionFactory == null) return false;
/// Populate the database
//using (var session = sessionFactory.OpenSession())
//{
// using (var transaction = session.BeginTransaction())
// {
// /// Create one component
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
// session.SaveOrUpdate(cmpnt);
// transaction.Commit();
// }
//}
return true;
}
}
}
+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.928.0")]
[assembly: AssemblyFileVersion("2.18.928.0")]
[assembly: AssemblyVersion("2.18.1151.0")]
[assembly: AssemblyFileVersion("2.18.1151.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";
+76 -13
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()
@@ -273,7 +276,14 @@ namespace DeviceTest
radioButton3.Text = "SelectTank 3";
radioButton4.Text = "SelectTank -";
}
else radioButton1.Text = "spare";
else if (className == "Modbus.QuidoRS")
{
radioButton1.Text = "Close relay 1";
radioButton2.Text = "Close relay 2";
radioButton3.Text = "Close relay 3";
radioButton4.Text = "Open all relays";
}
else radioButton1.Text = "spare";
}
///
void UpdateOperations2(string className)
@@ -293,7 +303,14 @@ namespace DeviceTest
radioButton23.Text = "SelectTank 3";
radioButton24.Text = "SelectTank -";
}
else radioButton21.Text = "spare";
else if (className == "Modbus.QuidoRS")
{
radioButton21.Text = "Close relay 1";
radioButton22.Text = "Close relay 2";
radioButton23.Text = "Close relay 3";
radioButton24.Text = "Open all relays";
}
else radioButton21.Text = "spare";
}
///
void UpdateOperations3(string className)
@@ -313,7 +330,14 @@ namespace DeviceTest
radioButton33.Text = "SelectTank 3";
radioButton34.Text = "SelectTank -";
}
else radioButton31.Text = "spare";
else if (className == "Modbus.QuidoRS")
{
radioButton31.Text = "Close relay 1";
radioButton32.Text = "Close relay 2";
radioButton33.Text = "Close relay 3";
radioButton34.Text = "Open all relays";
}
else radioButton31.Text = "spare";
}
@@ -657,13 +681,25 @@ 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);
//operation3 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
//operation4 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
operation1 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
operation2 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
operation3 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
operation4 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
}
if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
@@ -681,16 +717,28 @@ 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);
//operation23 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
//operation24 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
operation21 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
operation22 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
operation23 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
operation24 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
}
if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
@@ -708,23 +756,38 @@ 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);
//operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
//operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
}
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);
-15
View File
@@ -121,21 +121,6 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<COMReference Include="GemCardExLib">
<Guid>{F1FF634B-BEDF-461C-A409-5B88E05F5117}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
<COMReference Include="SCARDSSPLib">
<Guid>{82C38704-19F1-11D3-A11F-00C04F79F800}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
</COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
-68
View File
@@ -1,68 +0,0 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class Process
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual ReleaseStatus ReleaseStatus { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual string UserName { get; set; }
public virtual IList<Part> Parts { get; set; }
public virtual IList<Workstep> Worksteps { get; set; }
/// <summary>
/// Default (private) constructor inicializing lists
/// </summary>
protected Process()
{
Parts = new List<Part>();
Worksteps = new List<Workstep>();
}
/// <summary>
/// Constructor used when this process is created
/// </summary>
/// <param name="name"></param>
public Process(string name)
: this()
{
Name = name;
Description = string.Empty;
ReleaseStatus = ReleaseStatus.In_preparation;
TimeStamp = DateTime.Now;
UserName = "admin";
}
/// <summary>
/// Create a copy of a process with a new name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public virtual Process Clone(string name)
{
Process rslt = new Process(name);
rslt.Description = Description;
foreach (var part in Parts) rslt.Parts.Add(part.Clone(rslt));
foreach (var workstep in Worksteps) rslt.Worksteps.Add(workstep.Clone(rslt));
return rslt;
}
public override string ToString()
{
return string.Format("{0} '{1}' ({2}) {3} {4}",
ItemNr,
Name,
TimeStamp.Date.ToShortDateString(),
(Description == null) ? string.Empty : Description,
ReleaseStatus);
}
}
}
-94
View File
@@ -1,94 +0,0 @@
namespace MonitoringDB
{
public enum CodeType
{
UniqueNr,
FlowtubeNr, /// prvé 3 znaky sa zhodujú s poslednými 3 znakmi názvu
FlowtubeNrLU, /// začiatok kódu sa zhoduje s názvom
BatchNr,
BatchNrContainingPartName,
DateMMYY,
QualityCheck,
}
public enum CodeForm
{
Barcode,
QRCode,
Keyboard,
OkNok,
}
public enum CodeLocation
{
OnPart,
OnPallet,
}
public enum LifetimeManagement
{
None,
OneYear,
Count,
}
public enum ReleaseStatus
{
In_preparation,
Released,
ReleasedActive,
Deactivated,
Count,
}
public enum Mode
{
Debug, // Debug mode - no Oracle database used
Test, // Test database used
Production, // Production database used
Count,
}
public enum LoginLevel
{
None,
TeamLeader,
Administrator,
MH,
Count,
}
public enum ItemSpecID
{
RefRecordID = 0,
TimeStamp,
Workstep,
Workplace,
UserName,
Barcode,
PartBarcode,
TimeStamp2,
Workstep2,
Workplace2,
UserName2,
Barcode2,
PartBarcode2,
SerialNr,
PurchaseOrder,
TestResult,
MaxPruefindex,
Process,
}
public enum ItemSpecCaps
{
None = 0,
ReferenceRecord = 1,
AssociatedRecord = 2,
OracleQuery = 4,
}
}
-212
View File
@@ -1,212 +0,0 @@
using System;
using System.Collections.Generic;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
namespace MonitoringDB
{
public static class FluentNH
{
/// <summary>
/// Current session factory for the last used connection string or null
/// </summary>
public static ISessionFactory SessionFactory;
/// <summary> Connection string for all sessions </summary>
static string connectionString;
///
public static string ConnectionString
{
get { return connectionString; }
set
{
if (value != connectionString)
{
connectionString = value;
SessionFactory = null; /// Clear SessionFactory on connection string change
}
}
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
static ISessionFactory CreateSessionFactory()
{
return CreateSessionFactory(false);
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
public static ISessionFactory CreateSessionFactory(bool createDB)
{
FluentConfiguration cfg = Fluently
.Configure()
.Database(MySQLConfiguration.Standard.ConnectionString(connectionString))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.Process>());
if (createDB)
{
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
}
else
{
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
}
}
public delegate void BuildSchemaDlgt(Configuration config);
public static void BuildSchema(Configuration config)
{
/// This NHibernate tool takes a configuration (with mapping info in)
/// and exports a database schema from it
new SchemaExport(config).SetOutputFile("db_schema");
}
static void BuildSchemaCreate(Configuration config)
{
/// This NHibernate tool takes a configuration (with mapping info in)
/// and exports a database schema from it
new SchemaExport(config).Create(true, true);
}
/// Create a NHibernate session for the given database
public static ISession CreateSession(string connectionString)
{
ConnectionString = connectionString; /// Clears session factory on connction string change
if (SessionFactory == null)
SessionFactory = CreateSessionFactory();
return SessionFactory.OpenSession();
}
/// <summary>
/// Create an empty database.
/// Database contains only the user 'admin' and the control board component 'CB'.
/// </summary>
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
/// <param name="connectionString">Connection string</param>
/// <returns>true=success, false=error</returns>
public static bool CreateEmptyDB(string connectionString)
{
ConnectionString = connectionString;
ISessionFactory sessionFactory = CreateSessionFactory(true);
if (sessionFactory == null) return false;
/// Populate the database
using (var session = sessionFactory.OpenSession())
{
//using (var transaction = session.BeginTransaction())
//{
// var part1 = new MonitoringDB.Entities.Part("flow tube", CodeType.UniqueNr, CodeForm.QRCode, 0);
// session.SaveOrUpdate(part1);
// transaction.Commit();
//}
}
return true;
}
public static IList<WMPart> FindWMParts(string pcbNumber, string connString)
{
IList<WMPart> foundParts = new List<WMPart>(); /// initially empty
if (string.IsNullOrEmpty(pcbNumber)) return foundParts; /// return an empty list
try
{
ISession session = CreateSession(connString);
IList<Entities.ReferenceRecord> referenceRecords = session
.QueryOver<Entities.ReferenceRecord>()
.Where(x => (x.Code == pcbNumber))
.OrderBy(x => x.TimeStamp).Desc
.List<Entities.ReferenceRecord>();
if (referenceRecords.Count == 0) return foundParts;
foundParts.Add(new WMPart(referenceRecords[0]));
Entities.Process process = referenceRecords[0].Process;
///
foreach (var refR in referenceRecords)
{
if (process != refR.Process)
{
continue; /// skip records obtained by another process
}
IList<Entities.Record> relatedRecords = session
.QueryOver<Entities.Record>()
.Where(x => (x.ReferenceRecord == refR))
.List<Entities.Record>();
foreach (var relR in relatedRecords)
{
foundParts.Add(new WMPart(relR));
foreach (var ws in process.Worksteps)
{
if (ws.ReferencePart == relR.Part)
{
FindWMPartsRecursively(process, ws.ReferencePart, relR.Code, session, ref foundParts);
}
}
}
}
}
catch
{
}
return foundParts;
}
static void FindWMPartsRecursively(Entities.Process process, Entities.Part refPart, string code, ISession session, ref IList<WMPart> foundParts)
{
IList<Entities.ReferenceRecord> referenceRecords = session
.QueryOver<Entities.ReferenceRecord>()
.Where(x => (x.Workstep.ReferencePart == refPart))
.Where(x => (x.Code == code))
.OrderBy(x => x.TimeStamp).Desc
.List<Entities.ReferenceRecord>();
if (referenceRecords.Count == 0) return;
foreach (var refR in referenceRecords)
{
IList<Entities.Record> relatedRecords = session
.QueryOver<Entities.Record>()
.Where(x => (x.ReferenceRecord == refR))
.List<Entities.Record>();
foreach (var relR in relatedRecords)
{
foundParts.Add(new WMPart(relR));
foreach (var ws in process.Worksteps)
{
if (ws.ReferencePart == relR.Part)
{
FindWMPartsRecursively(process, ws.ReferencePart, relR.Code, session, ref foundParts);
}
}
}
}
}
}
}
-263
View File
@@ -1,263 +0,0 @@
namespace MonitoringDB.Forms
{
partial class SettingsDlg
{
/// <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.groupBox1 = new System.Windows.Forms.GroupBox();
this.connectionStringTextBox = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.workplaceNameTextBox = new System.Windows.Forms.TextBox();
this.saveButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.extraBatteryLifetimeTextBox = new System.Windows.Forms.TextBox();
this.oracleGroupBox = new System.Windows.Forms.GroupBox();
this.checkPcbIsInOracleCheckBox = new System.Windows.Forms.CheckBox();
this.oracleBatteryCheckBox = new System.Windows.Forms.CheckBox();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.usersDBConnStringTextBox = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.oracleGroupBox.SuspendLayout();
this.groupBox5.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.connectionStringTextBox);
this.groupBox1.Location = new System.Drawing.Point(12, 69);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(622, 50);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Connection string pre záznamy z výroby";
//
// connectionStringTextBox
//
this.connectionStringTextBox.Location = new System.Drawing.Point(17, 18);
this.connectionStringTextBox.Name = "connectionStringTextBox";
this.connectionStringTextBox.Size = new System.Drawing.Size(586, 20);
this.connectionStringTextBox.TabIndex = 0;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.radioButton2);
this.groupBox2.Controls.Add(this.radioButton1);
this.groupBox2.Location = new System.Drawing.Point(12, 250);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(268, 70);
this.groupBox2.TabIndex = 4;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Režim činnosti";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(101, 41);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(58, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "Výroba";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Location = new System.Drawing.Point(101, 20);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(46, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Test";
this.radioButton1.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.workplaceNameTextBox);
this.groupBox3.Location = new System.Drawing.Point(12, 12);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(622, 50);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Meno pracoviska";
//
// workplaceNameTextBox
//
this.workplaceNameTextBox.Location = new System.Drawing.Point(17, 18);
this.workplaceNameTextBox.Name = "workplaceNameTextBox";
this.workplaceNameTextBox.Size = new System.Drawing.Size(586, 20);
this.workplaceNameTextBox.TabIndex = 0;
//
// saveButton
//
this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveButton.Location = new System.Drawing.Point(348, 270);
this.saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(104, 42);
this.saveButton.TabIndex = 6;
this.saveButton.Text = "Uložiť";
this.saveButton.UseVisualStyleBackColor = true;
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Location = new System.Drawing.Point(488, 270);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 42);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Zrušiť";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.extraBatteryLifetimeTextBox);
this.groupBox4.Location = new System.Drawing.Point(12, 182);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(268, 62);
this.groupBox4.TabIndex = 3;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Predĺženie životnosti baterky v mesiacoch";
//
// extraBatteryLifetimeTextBox
//
this.extraBatteryLifetimeTextBox.Location = new System.Drawing.Point(17, 25);
this.extraBatteryLifetimeTextBox.Name = "extraBatteryLifetimeTextBox";
this.extraBatteryLifetimeTextBox.Size = new System.Drawing.Size(230, 20);
this.extraBatteryLifetimeTextBox.TabIndex = 0;
//
// oracleGroupBox
//
this.oracleGroupBox.Controls.Add(this.checkPcbIsInOracleCheckBox);
this.oracleGroupBox.Controls.Add(this.oracleBatteryCheckBox);
this.oracleGroupBox.Location = new System.Drawing.Point(297, 182);
this.oracleGroupBox.Name = "oracleGroupBox";
this.oracleGroupBox.Size = new System.Drawing.Size(337, 74);
this.oracleGroupBox.TabIndex = 5;
this.oracleGroupBox.TabStop = false;
this.oracleGroupBox.Text = "Oracle";
this.oracleGroupBox.Visible = false;
//
// checkPcbIsInOracleCheckBox
//
this.checkPcbIsInOracleCheckBox.AutoSize = true;
this.checkPcbIsInOracleCheckBox.Location = new System.Drawing.Point(18, 45);
this.checkPcbIsInOracleCheckBox.Name = "checkPcbIsInOracleCheckBox";
this.checkPcbIsInOracleCheckBox.Size = new System.Drawing.Size(213, 17);
this.checkPcbIsInOracleCheckBox.TabIndex = 0;
this.checkPcbIsInOracleCheckBox.Text = "Skontrolovať či PCB už bola overovaná";
this.checkPcbIsInOracleCheckBox.UseVisualStyleBackColor = true;
//
// oracleBatteryCheckBox
//
this.oracleBatteryCheckBox.AutoSize = true;
this.oracleBatteryCheckBox.Location = new System.Drawing.Point(18, 19);
this.oracleBatteryCheckBox.Name = "oracleBatteryCheckBox";
this.oracleBatteryCheckBox.Size = new System.Drawing.Size(193, 17);
this.oracleBatteryCheckBox.TabIndex = 0;
this.oracleBatteryCheckBox.Text = "Uložiť informácie o batérii do Oracle";
this.oracleBatteryCheckBox.UseVisualStyleBackColor = true;
//
// groupBox5
//
this.groupBox5.Controls.Add(this.usersDBConnStringTextBox);
this.groupBox5.Location = new System.Drawing.Point(12, 125);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(622, 50);
this.groupBox5.TabIndex = 2;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Connection string pre centrálnu databázu používateľov";
//
// usersDBConnStringTextBox
//
this.usersDBConnStringTextBox.Location = new System.Drawing.Point(17, 18);
this.usersDBConnStringTextBox.Name = "usersDBConnStringTextBox";
this.usersDBConnStringTextBox.Size = new System.Drawing.Size(586, 20);
this.usersDBConnStringTextBox.TabIndex = 0;
//
// SettingsDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(648, 333);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.oracleGroupBox);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.saveButton);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "SettingsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "SettingsDlg";
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.oracleGroupBox.ResumeLayout(false);
this.oracleGroupBox.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox connectionStringTextBox;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox workplaceNameTextBox;
private System.Windows.Forms.Button saveButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox extraBatteryLifetimeTextBox;
private System.Windows.Forms.GroupBox oracleGroupBox;
private System.Windows.Forms.CheckBox oracleBatteryCheckBox;
private System.Windows.Forms.CheckBox checkPcbIsInOracleCheckBox;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TextBox usersDBConnStringTextBox;
}
}
-87
View File
@@ -1,87 +0,0 @@
using System;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class SettingsDlg : Form
{
public string WorkplaceName
{
set { workplaceNameTextBox.Text = value; }
get { return workplaceNameTextBox.Text; }
}
public string ConnectionString
{
set { connectionStringTextBox.Text = value; }
get { return connectionStringTextBox.Text; }
}
public string UsersDBConnString
{
set { usersDBConnStringTextBox.Text = value; }
get { return usersDBConnStringTextBox.Text; }
}
public bool OracleBattery
{
set { oracleBatteryCheckBox.Checked = value; }
get { return oracleBatteryCheckBox.Checked; }
}
public bool CheckPcbIsInOracle
{
set { checkPcbIsInOracleCheckBox.Checked = value; }
get { return checkPcbIsInOracleCheckBox.Checked; }
}
public int ExtraBatterLifetime
{
get
{
int extraLifetime;
if (int.TryParse(extraBatteryLifetimeTextBox.Text, out extraLifetime) && extraLifetime >= 0) return extraLifetime;
return 0;
}
}
public MonitoringDB.Mode Mode
{
set
{
radioButton1.Checked = (value == MonitoringDB.Mode.Test);
radioButton2.Checked = (value == MonitoringDB.Mode.Production);
}
get
{
return radioButton1.Checked ? MonitoringDB.Mode.Test : MonitoringDB.Mode.Production;
}
}
/// <summary>
/// Basic configuration dialog
/// </summary>
/// <param name="isWorkplace">false = Konfiguracia pracovisk, true = Pracovisko</param>
public SettingsDlg(bool isWorkplace)
{
InitializeComponent();
if (isWorkplace)
{
oracleGroupBox.Visible = true;
}
extraBatteryLifetimeTextBox.Text = "0";
}
private void saveButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
-49
View File
@@ -1,49 +0,0 @@
using System;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class TrivialLoginDlg : Form
{
public LoginLevel LoginLevel;
public TrivialLoginDlg()
{
InitializeComponent();
LoginLevel = LoginLevel.None;
}
private void okButton_Click(object sender, EventArgs e)
{
if (passwordTextBox.Text.ToLower().Equals("barcode"))
{
LoginLevel = LoginLevel.Administrator;
DialogResult = DialogResult.OK;
Close();
}
else if (passwordTextBox.Text.ToLower().Equals("teamleader"))
{
LoginLevel = LoginLevel.TeamLeader;
DialogResult = DialogResult.OK;
Close();
}
else if (passwordTextBox.Text.ToLower().Equals("kremik"))
{
LoginLevel = LoginLevel.MH;
DialogResult = DialogResult.OK;
Close();
}
else
{
DialogResult = DialogResult.Cancel;
Close();
}
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
-105
View File
@@ -1,105 +0,0 @@
namespace MonitoringDB.Forms
{
partial class TrivialLoginDlg
{
/// <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.passwordGroupBox = new System.Windows.Forms.GroupBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.passwordGroupBox.SuspendLayout();
this.SuspendLayout();
//
// passwordGroupBox
//
this.passwordGroupBox.Controls.Add(this.passwordTextBox);
this.passwordGroupBox.Location = new System.Drawing.Point(12, 10);
this.passwordGroupBox.Name = "passwordGroupBox";
this.passwordGroupBox.Size = new System.Drawing.Size(200, 49);
this.passwordGroupBox.TabIndex = 0;
this.passwordGroupBox.TabStop = false;
this.passwordGroupBox.Text = "Heslo";
//
// passwordTextBox
//
this.passwordTextBox.Location = new System.Drawing.Point(51, 18);
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.PasswordChar = '*';
this.passwordTextBox.Size = new System.Drawing.Size(100, 20);
this.passwordTextBox.TabIndex = 0;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(237, 18);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 39);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(330, 18);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 39);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// LoginDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(426, 73);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.passwordGroupBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "LoginDlg";
this.Text = "LoginDlg";
this.passwordGroupBox.ResumeLayout(false);
this.passwordGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox passwordGroupBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
}
}
-25
View File
@@ -1,25 +0,0 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class ProcessMap : ClassMap<Entities.Process>
{
public ProcessMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.ReleaseStatus);
Map(x => x.TimeStamp);
Map(x => x.UserName);
HasMany(x => x.Parts)
.OrderBy("Name")
.Cascade.All();
HasMany(x => x.Worksteps)
.OrderBy("WorkstepNr")
.Cascade.All();
}
}
}
+14 -6
View File
@@ -27,8 +27,8 @@ namespace Results
public Batch Batch;
public WaterMeter[] WaterMeters;
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
Config.Entities.Procedure procedure,
public static BatchResults NewFromProcedure(int batchNr, int benchId, string benchName, string a1, string a2, string a3, string a4, string a5,
string user, int userNr, string programVer, Config.Entities.Procedure procedure,
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
{
BatchResults d = new BatchResults(waterMeterDatas.Length);
@@ -37,8 +37,14 @@ namespace Results
/// Create new batch
d.Batch = new Batch()
{
TestBenchId = benchId,
BatchNr = batchNr,
BatchNr = batchNr,
TestBenchId = benchId,
TestBenchName = benchName,
Address1 = a1,
Address2 = a2,
Address3 = a3,
Address4 = a4,
Address5 = a5,
ProgramVersion = programVer,
UserName = user,
UserNumber = userNr,
@@ -90,7 +96,7 @@ namespace Results
{
if (d.WaterMeters[i] == null) continue;
if (t.Part != 0 && waterMeterParts[i] != 0 && t.Part != waterMeterParts[i]) continue;
if (!t.IsPartCompatible(waterMeterParts[i])) continue;
///
/// Create empty watermeter test results and add them to the list and to dictionaries
@@ -199,8 +205,10 @@ namespace Results
{
foreach (var mtr in WaterMeters[i].MeterTestRslts)
{
if (mtr.TestData().Name.ToLower().Contains("adj"))
if (mtr.TestData().Name.ToLower().Contains("adj") || mtr.TestData().Name.ToLower().Contains("just"))
{
return true;
}
}
}
}
+7 -1
View File
@@ -11,7 +11,13 @@ namespace Results.Entities
public virtual int Id { get; protected set; }
public virtual int BatchNr { get; set; }
public virtual int TestBenchId { get; set; }
public virtual string ProgramVersion { get; set; }
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
public virtual string ProgramVersion { get; set; }
public virtual string UserName { get; set; }
public virtual int UserNumber { get; set; }
public virtual string ProcedureName { get; set; }
+15 -3
View File
@@ -25,9 +25,13 @@ namespace Results.Entities
/// Main result
public virtual double Error { get; set; } /// [%]
public virtual int ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28
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 +84,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 -2
View File
@@ -20,8 +20,8 @@ namespace Results.Entities
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
public virtual double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
+16 -3
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.
@@ -147,7 +148,7 @@ namespace Results.Entities
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(TestData.ErrLimLo);
double Qp = Math.Abs(TestData.ErrLimHi);
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
double Q = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
@@ -171,7 +172,7 @@ namespace Results.Entities
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(TestData.ErrLimLo);
double Qp = Math.Abs(TestData.ErrLimHi);
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
double Q = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
@@ -318,6 +319,18 @@ namespace Results.Entities
#endif
}
public virtual bool IsPartCompatible(int waterMeterPartNr)
{
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
if ((this.Part % 10) == waterMeterPartNr) return true;
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
return false;
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
+121 -28
View File
@@ -41,8 +41,8 @@ namespace Results.Entities
public class WaterMeter
{
public virtual int Id { get; protected set; }
public virtual string SerialNr { get; set; } /// Main s/n for compound meters, PCB Number for iPerl water meter
public virtual string SerialNrAux { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual string SerialNr { get; set; } /// S/N _or_ S/N of the main meter of a compound meter _or_ PCB Number of an iPerl water meter
public virtual string SerialNrAux { get; set; } /// S/N of the aux. meter of a compound meter _or_ a complete assigned S/N of an iPerl water meter
public virtual string PurchaseOrder { get; set; }
public virtual int YearOfProduction { get; set; }
public virtual int WMPosition { get; set; }
@@ -57,25 +57,48 @@ namespace Results.Entities
public virtual string Remark { get; set; }
#if IPERL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl 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 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 CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
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
public virtual int Hz2Correction { get; set; } /// iPerl Q2 correction used during the test
public virtual string FWVersion { get; set; }
#endif
#if ORACLE_DB
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
#if TURA_SPECIAL
/// <summary>
/// Data from a production test bench (in case of tests on iPerl special)
/// </summary>
public virtual int AssignedSerialNr { get; set; }
public virtual string CompleteSerialNr { get; set; }
public virtual string RadioAddress { get; set; }
public virtual int PaletteNr { get; set; }
public virtual int UmkartonNr { get; set; }
public virtual string ProdTestBench { get; set; }
public virtual int ProdWMPosition { get; set; }
public virtual string ProdUserName { get; set; }
public virtual string ProdPurchaseOrder { get; set; }
public virtual bool ProdPassed { get; set; }
public virtual int ProdResultCode { get; set; }
public virtual int ProdQ2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
#endif
public virtual WaterMeterData WaterMeterData { get; set; }
#if ORACLE_DB
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
public virtual int HydrPruefung { get; set; }
public virtual int WMTypeRevision { get; set; } /// Not mapped to DB !!!
public virtual object RawTestInfos { get; set; } /// IList<SensusTestInfo> fetched from Oracle at the beginning of the cycle, not mapped to DB !!!
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
#endif
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
public virtual bool IsLastRecordOk { get; set; } /// Not mapped to DB !!! Previous record verification result
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual Batch Batch { get; set; }
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
@@ -117,7 +140,7 @@ namespace Results.Entities
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
foreach (var mtr in MeterTestRslts)
{
if (mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
if (mtr.Evaluate() && mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
if ((int)mtr.TestRslt.ErrorFlagsMode() > (int)eFlagsMode) eFlagsMode = mtr.TestRslt.ErrorFlagsMode();
}
errorFlagsMode = eFlagsMode; /// Maximum from all tests (=ErrorFlagsMode.On if at least one test is ErrorFlagsMode.On)
@@ -149,7 +172,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>
@@ -209,9 +232,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);
}
}
@@ -252,7 +283,12 @@ namespace Results.Entities
{
return mtr;
}
}
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound &&
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy)
{
return mtr;
}
}
}
return null;
}
@@ -264,6 +300,21 @@ namespace Results.Entities
return null;
}
public virtual bool TryGetTestRslt(string testName, out TestRslt testRslt)
{
MeterTestRslt mtr = GetMeterTestRslt(testName);
if (mtr != null)
{
testRslt = mtr.TestRslt;
return true;
}
else
{
testRslt = null;
return false;
}
}
public virtual TestData GetTestData(string testName)
{
foreach (var mtr in MeterTestRslts)
@@ -276,6 +327,21 @@ namespace Results.Entities
return null;
}
public virtual bool TryGetTestData(string testName, out TestData testData)
{
foreach (var mtr in MeterTestRslts)
{
if (mtr.TestRslt.TestData.Name == testName)
{
testData = mtr.TestRslt.TestData;
return true;
}
}
testData = null;
return false;
}
/// <summary>
@@ -284,6 +350,15 @@ namespace Results.Entities
public WaterMeter()
{
MeterTestRslts = new List<MeterTestRslt>();
#if ORACLE_DB
Pruefindex = 1;
HydrPruefung = 0;
WMTypeRevision = 0;
RawTestInfos = null;
CompleteTestInfos = null;
#endif
ProcessId = 0;
IsLastRecordOk = false;
}
@@ -306,24 +381,42 @@ namespace Results.Entities
ArchivePath = src.ArchivePath;
Remark = src.Remark;
#if IPERL
SerialNrEx = src.SerialNrEx;
OrigCalibFactor = src.OrigCalibFactor;
CalibFactor = src.CalibFactor;
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;
Hz2Correction = src.Hz2Correction;
FWVersion = src.FWVersion;
#endif
#if ORACLE_DB
Pruefindex = src.Pruefindex;
HydrPruefung = src.HydrPruefung;
#if TURA_SPECIAL
AssignedSerialNr = src.AssignedSerialNr;
CompleteSerialNr = src.CompleteSerialNr;
RadioAddress = src.RadioAddress;
PaletteNr = src.PaletteNr;
UmkartonNr = src.UmkartonNr;
ProdTestBench = src.ProdTestBench;
ProdWMPosition = src.ProdWMPosition;
ProdUserName = src.ProdUserName;
ProdPurchaseOrder = src.ProdPurchaseOrder;
ProdPassed = src.ProdPassed;
ProdResultCode = src.ProdResultCode;
ProdQ2CorrRL = src.ProdQ2CorrRL;
ProdQ2CorrLR = src.ProdQ2CorrLR;
#endif
#if ORACLE_DB
Pruefindex = src.Pruefindex;
HydrPruefung = src.HydrPruefung;
WMTypeRevision = src.WMTypeRevision;
RawTestInfos = src.RawTestInfos;
CompleteTestInfos = src.CompleteTestInfos;
#endif
ProcessId = src.ProcessId;
IsLastRecordOk = src.IsLastRecordOk;
foreach (var mtr in MeterTestRslts)
{
MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (Config.Entities.CompoundMeterId)mtr.CompoundMeterId);
@@ -339,7 +432,7 @@ namespace Results.Entities
{
StringBuilder sb = new StringBuilder(80);
#if IPERL
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrEx);
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrAux);
#else
sb.AppendFormat("S/N:{0} ", SerialNr);
#endif
-2
View File
@@ -54,7 +54,6 @@ namespace Results.Entities
#if ORACLE_DB
public virtual int WMTypeId { get; set; }
public virtual int WMTypeRev { get; set; }
#endif
public WaterMeterData()
@@ -111,7 +110,6 @@ namespace Results.Entities
#if ORACLE_DB
if (WMTypeId != wmd.WMTypeId) return false;
if (WMTypeRev != wmd.WMTypeRev) return false;
#endif
return true;
}
+91 -22
View File
@@ -16,6 +16,16 @@ namespace Results.Forms
{
static readonly ILog log = LogManager.GetLogger(typeof(BatchResultsDlg));
static readonly Color NotCompletedColor = Color.White;
static readonly Color OkColor = Color.LightGreen;
static readonly Color NokColor = Color.LightPink;
static readonly Color RejectColor = Color.Magenta;
static readonly Color ProductionTracing = Color.RoyalBlue;
static readonly Color WrongDirection = Color.Gold;
static readonly Color WrongQ2FactorsColor = Color.Red;
DateTime lastRedraw;
DateTime lastSizeChange;
bool loaded;
@@ -45,7 +55,7 @@ namespace Results.Forms
Results.BatchResults results;
MetersKind metersKind;
ListView firstListView;
OneWMResultsCtrl firstListView;
public int[] rsltsClmnWidths;
int rsltsClmnCount { get { return (rsltsClmnWidths != null) ? rsltsClmnWidths.Length : 0; } }
@@ -150,9 +160,9 @@ namespace Results.Forms
{
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
{
ListView lview = (TestsArrangement == TestsArrangement.Rows)
? GetResultsTestsAreRows(results.WaterMeters[i], i + 1)
: GetResultsTestsAreColumns(results.WaterMeters[i], i + 1);
OneWMResultsCtrl lview = (TestsArrangement == TestsArrangement.Rows)
? GetResultsTestsAreRows(results.WaterMeters[i], i + 1)
: GetResultsTestsAreColumns(results.WaterMeters[i], i + 1);
if (lview != null)
{
flowLayoutPanel.Controls.Add(lview);
@@ -178,24 +188,16 @@ namespace Results.Forms
this.ResumeLayout(false);
}
/// <summary>
/// Get an empty ListView control with appropriate parameters.
/// </summary>
/// <returns>ListView control</returns>
ListView GetListView()
OneWMResultsCtrl GetListView(Color backColor)
{
ListView lview = new ListView();
lview.AllowColumnReorder = false;
lview.Dock = System.Windows.Forms.DockStyle.None;
lview.FullRowSelect = true;
lview.GridLines = true;
lview.Location = new System.Drawing.Point(0, 0);
lview.Size = new System.Drawing.Size(lvWidth, lvHeight);
lview.TabIndex = 0;
lview.UseCompatibleStateImageBehavior = false;
lview.View = System.Windows.Forms.View.Details;
return lview;
return new OneWMResultsCtrl(backColor, lvWidth, lvHeight);
}
OneWMResultsCtrl GetListView() { return GetListView(Color.White); }
/// <summary>
@@ -209,8 +211,10 @@ namespace Results.Forms
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.IsPilotRslt() && mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
testNames.Add(mtr.Name());
}
@@ -219,17 +223,75 @@ namespace Results.Forms
return testNames;
}
/// <summary>
/// Get color for highlighting results and an apporpriate text message.
/// </summary>
/// <param name="wMtr">Water meter results entity</param>
/// <param name="message">Appropriate message</param>
/// <returns>Color for results</returns>
Color GetColorOfResults(Results.Entities.WaterMeter wMtr, out string message)
{
bool wmtrCompleted = wMtr.CompletedFromTests();
bool wmtrPassed = wMtr.PassedFromTests();
if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E28) != 0)
{
message = Strings.Previous_step_is_missing_or_NOK;
return ProductionTracing;
}
else if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E27) != 0)
{
message = Strings.Wrong_iPerl_counting_direction;
return WrongDirection;
}
else if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E26) != 0)
{
message = Strings.Invalid_Q2_correction_factors;
return WrongQ2FactorsColor;
}
else if ((wMtr.ErrorFlags & (int)ErrorFlagMask.E25) != 0)
{
message = Strings.Test_repetition_count_exceeded_upper_limit;
return RejectColor;
}
else if (wmtrPassed)
{
/// Water meter passed (therefore is was also completed)
message = Strings.Passed;
return OkColor;
}
else if (wmtrCompleted)
{
/// Water meter was completed but did not pass => Failed
message = Strings.Failed;
return NokColor;
}
else
{
/// Water meter was not completed yet => did not pass, did not fail
message = Strings.Test_in_progress;
return NotCompletedColor;
}
}
/// <summary>
/// Get a ListView control filled with results of the meter 'mtr'
/// </summary>
/// <param name="mtr">Water meter number (1-based): 1 .. Config.Data.WMsCount</param>
/// <returns>ListView object</returns>
ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
OneWMResultsCtrl GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
string message = string.Empty;
Color commonBackColor = GetColorOfResults(wMtr, out message);
OneWMResultsCtrl lview = GetListView(commonBackColor);
#if ORACLE_DB
lview.Caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
#else
lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
#endif
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
@@ -290,11 +352,18 @@ namespace Results.Forms
/// </summary>
/// <param name="mtr">Water meter number (1-based): 1 .. Config.Data.WMsCount</param>
/// <returns>ListView object</returns>
ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
OneWMResultsCtrl GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
string message;
Color commonBackColor = GetColorOfResults(wMtr, out message);
OneWMResultsCtrl lview = GetListView(commonBackColor);
#if ORACLE_DB
lview.Caption = string.Format("{0} ({1}) {2}", (string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr), (wMtr.Pruefindex % 100), message);
#else
lview.Caption = string.Format("s/n = {0}", string.IsNullOrEmpty(wMtr.SerialNr) ? string.Empty : wMtr.SerialNr);
#endif
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
+104
View File
@@ -0,0 +1,104 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Results.Forms
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ListViewExtensions
{
[StructLayout(LayoutKind.Sequential)]
public struct HDITEM
{
public Mask mask;
public int cxy;
[MarshalAs(UnmanagedType.LPTStr)]
public string pszText;
public IntPtr hbm;
public int cchTextMax;
public Format fmt;
public IntPtr lParam;
// _WIN32_IE >= 0x0300
public int iImage;
public int iOrder;
// _WIN32_IE >= 0x0500
public uint type;
public IntPtr pvFilter;
// _WIN32_WINNT >= 0x0600
public uint state;
[Flags]
public enum Mask
{
Format = 0x4, // HDI_FORMAT
};
[Flags]
public enum Format
{
SortDown = 0x200, // HDF_SORTDOWN
SortUp = 0x400, // HDF_SORTUP
};
};
public const int LVM_FIRST = 0x1000;
public const int LVM_GETHEADER = LVM_FIRST + 31;
public const int HDM_FIRST = 0x1200;
public const int HDM_GETITEM = HDM_FIRST + 11;
public const int HDM_SETITEM = HDM_FIRST + 12;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, SortOrder order)
{
IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)
{
var columnPtr = new IntPtr(columnNumber);
var item = new HDITEM
{
mask = HDITEM.Mask.Format
};
if (SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero)
{
throw new Win32Exception();
}
if (order != SortOrder.None && columnNumber == columnIndex)
{
switch (order)
{
case SortOrder.Ascending:
item.fmt &= ~HDITEM.Format.SortDown;
item.fmt |= HDITEM.Format.SortUp;
break;
case SortOrder.Descending:
item.fmt &= ~HDITEM.Format.SortUp;
item.fmt |= HDITEM.Format.SortDown;
break;
default:
break;
}
}
else
{
item.fmt &= ~HDITEM.Format.SortDown & ~HDITEM.Format.SortUp;
}
if (SendMessage(columnHeader, HDM_SETITEM, columnPtr, ref item) == IntPtr.Zero)
{
throw new Win32Exception();
}
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Windows.Forms;
namespace Results.Forms
{
public class LviIntColumnComparer : IComparer
{
int column;
SortOrder order;
public LviIntColumnComparer()
{
column = 0;
order = SortOrder.Ascending;
}
public LviIntColumnComparer(int column, SortOrder order)
{
this.column = column;
this.order = order;
}
public int Compare(object x, object y)
{
int valX = int.Parse(((ListViewItem)x).SubItems[column].Text);
int valY = int.Parse(((ListViewItem)y).SubItems[column].Text);
return (order == SortOrder.Descending) ? (valY - valX) : (valX - valY);
}
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Windows.Forms;
namespace Results.Forms
{
public class LviTextColumnComparer : IComparer
{
private int column;
SortOrder order;
public LviTextColumnComparer()
{
column = 0;
order = SortOrder.Ascending;
}
public LviTextColumnComparer(int column, SortOrder order)
{
this.column = column;
this.order = order;
}
public int Compare(object x, object y)
{
string txtX = ((ListViewItem)x).SubItems[column].Text;
string txtY = ((ListViewItem)y).SubItems[column].Text;
return (order == SortOrder.Descending) ? String.Compare(txtY, txtX) : String.Compare(txtX, txtY);
}
}
}
+102
View File
@@ -0,0 +1,102 @@
namespace Results.Forms
{
partial class OneWMResultsCtrl
{
/// <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.tBox = new System.Windows.Forms.TextBox();
this.lView = new System.Windows.Forms.ListView();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tBox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lView);
this.splitContainer1.Size = new System.Drawing.Size(352, 318);
this.splitContainer1.SplitterDistance = 25;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// tBox
//
this.tBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.tBox.Location = new System.Drawing.Point(0, 0);
this.tBox.Name = "tBox";
this.tBox.Size = new System.Drawing.Size(352, 20);
this.tBox.TabIndex = 0;
//
// lView
//
this.lView.Dock = System.Windows.Forms.DockStyle.Fill;
this.lView.FullRowSelect = true;
this.lView.GridLines = true;
this.lView.Location = new System.Drawing.Point(0, 0);
this.lView.Name = "lView";
this.lView.Size = new System.Drawing.Size(352, 292);
this.lView.TabIndex = 0;
this.lView.UseCompatibleStateImageBehavior = false;
this.lView.View = System.Windows.Forms.View.Details;
//
// OneWMResultsCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "OneWMResultsCtrl";
this.Size = new System.Drawing.Size(352, 318);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TextBox tBox;
private System.Windows.Forms.ListView lView;
}
}
+26
View File
@@ -0,0 +1,26 @@
using System.Drawing;
using System.Windows.Forms;
namespace Results.Forms
{
public partial class OneWMResultsCtrl : UserControl
{
public OneWMResultsCtrl()
{
InitializeComponent();
}
public OneWMResultsCtrl(Color backColor, int lvWidth, int lvHeight)
: this()
{
lView.BackColor = backColor;
tBox.BackColor = backColor;
Size = new System.Drawing.Size(lvWidth, lvHeight);
}
public string Caption { get { return tBox.Text; } set { tBox.Text = value; } }
public ListView.ColumnHeaderCollection Columns { get { return lView.Columns; } }
public ListView.ListViewItemCollection Items { get { return lView.Items; } }
public Color BColor { set { lView.BackColor = value; tBox.BackColor = value; } }
}
}
+110 -71
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
///
using System;
@@ -71,7 +71,7 @@ namespace Results
Pulse__liter, /// 61 Water meter constant (pulses per liter) specific for one test
Reference_pulses_ni, /// 62 Reference pulses gated for specific meter (synchro method)
Reference_energy, /// 63
Test_bench_ID, /// 64
Bench_ID, /// 64 Test bench ID (int) obtained from a component implementing IBenchInfo
Program_version, /// 65
User_name, /// 66
User_nr, /// 67
@@ -91,85 +91,85 @@ namespace Results
T_Lo_start, /// 81
T_Lo_end, /// 82
T_Lo_avg, /// 83
P_delta_mean, /// 84
P_delta_start, /// 85
P_delta_end, /// 86
Meter_type, /// 87 Single, Compound or HeatMeter
Volume_main, /// 88
Volume_aux, /// 89
Start_volume, /// 90
Start_volume_main, /// 91
Start_volume_aux, /// 92
End_volume, /// 93
End_volume_main, /// 94
End_volume_aux, /// 95
Error_main, /// 96
Error_aux, /// 97
Serial_Nr_main, /// 98
Serial_Nr_aux, /// 99
End_state_main, /// 100
End_state_aux, /// 101
Q_rise, /// 102
Q_fall, /// 103
P_delta_mean, /// 84
P_delta_start, /// 85
P_delta_end, /// 86
Meter_type, /// 87 Single, Compound or HeatMeter
Volume_main, /// 88
Volume_aux, /// 89
Start_volume, /// 90
Start_volume_main, /// 91
Start_volume_aux, /// 92
End_volume, /// 93
End_volume_main, /// 94
End_volume_aux, /// 95
Error_main, /// 96
Error_aux, /// 97
Serial_Nr_main, /// 98
Serial_Nr_aux, /// 99
End_state_main, /// 100
End_state_aux, /// 101
Q_rise, /// 102
Q_fall, /// 103
/// iPerl
/// iPerl
OrigCalibFactor, /// 104
CalibFactor, /// 105
Q2ErrWOCorrection, /// 106
Q2CorrectionDone, /// 107
CalibFactor, /// 105
Q2ErrWOCorrection, /// 106
Q2CorrectionDone, /// 107
Q2CorrRFlow, /// 108
Q2CorrLFlow, /// 109
Q2CorrFlowRight, /// 110
Q_ref_mean, /// 111
T_up_start, /// 112
T_up_end, /// 113
T_up_avg, /// 114
T_down_start, /// 115
T_down_end, /// 116
T_down_avg, /// 117
T_div_start, /// 118
T_div_end, /// 119
T_div_avg, /// 120
P_up_avg, /// 121
P_down_avg, /// 122
P_delta_avg, /// 123
TestDone, /// 124
TestPassed, /// 125
Q_ref_mean, /// 111
T_up_start, /// 112
T_up_end, /// 113
T_up_avg, /// 114
T_down_start, /// 115
T_down_end, /// 116
T_down_avg, /// 117
T_div_start, /// 118
T_div_end, /// 119
T_div_avg, /// 120
P_up_avg, /// 121
P_down_avg, /// 122
P_delta_avg, /// 123
TestDone, /// 124
TestPassed, /// 125
/// iPerl
FW_Version, /// 126
Mass_start_raw, /// 127
Mass_start, /// 128
Mass_end_raw, /// 129
Mass_end, /// 130
Mass, /// 131
Buoyancy, /// 132
Density_correction, /// 133
Mass_start_raw, /// 127
Mass_start, /// 128
Mass_end_raw, /// 129
Mass_end, /// 130
Mass, /// 131
Buoyancy, /// 132
Density_correction, /// 133
ErrorFlags, /// 134
E1, /// 135
E2, /// 136
E3, /// 137
E4, /// 138
E5, /// 139
E6, /// 140
E7, /// 141
E8, /// 142
E9, /// 143
E10, /// 144
E11, /// 145
E12, /// 146
E13, /// 147
E14, /// 148
E15, /// 149
E16, /// 150
ErrorFlags, /// 134
E1, /// 135
E2, /// 136
E3, /// 137
E4, /// 138
E5, /// 139
E6, /// 140
E7, /// 141
E8, /// 142
E9, /// 143
E10, /// 144
E11, /// 145
E12, /// 146
E13, /// 147
E14, /// 148
E15, /// 149
E16, /// 150
Table_row_nr, /// 151
Table_column_nr, /// 152
WMRemark, /// 153
Table_row_nr, /// 151
Table_column_nr, /// 152
WMRemark, /// 153
User_description, /// 154
Legalizator, /// 155
@@ -181,7 +181,7 @@ namespace Results
Diverter_start_time, /// 159
Diverter_end_time, /// 160
Q_sensitivity, /// 161
Q_ref_min, /// 162
Q_ref_max, /// 163
Q_ref_start, /// 164
@@ -210,7 +210,7 @@ namespace Results
Rho_Wa_calc, /// 183
Formatted_WM_ID, /// 184, Formated WM ID string:
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
/// {0}=start DateTime {1}-end DateTime, {2}=batch nr., {3}=wm pos.(1..max), {4}=s/n string
E21, /// 185
T_line_mean, /// 186
@@ -253,6 +253,45 @@ namespace Results
ConstMasterRaw, /// 219 ConstMaster (like 194) uncorrected
Reference_error_corr, /// 220 Reference flow meter error after correction using correction curve
Proc_description, /// 221 Procedure description (CEVAK, not mapped to DB)
Bench_name, /// 222 'Test bench name' (string) obtained from a component implementing IBenchInfo
Bench_address1, /// 223 'Address 1' from IBenchInfo
Bench_address2, /// 224 'Address 2' from IBenchInfo
Bench_address3, /// 225 'Address 3' from IBenchInfo
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
/// iPerl special
Prod_AssignedSerialNr, /// 234
Prod_CompleteSerialNr, /// 235
Prod_RadioAddress, /// 236
Prod_PaletteNr, /// 237
Prod_UmkartonNr, /// 238
Prod_TestBench, /// 239
Prod_WMPosition, /// 240
Prod_UserName, /// 241
Prod_PurchaseOrder, /// 242
Prod_Passed, /// 243
Prod_ResultCode, /// 244
Prod_Q2CorrRL, /// 245
Prod_Q2CorrLR, /// 246
TestPartStr, /// 247
Error_heat_mtr_vol, /// 248
Energy_start,
Energy_end,
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);
}
}
-1
View File
@@ -54,7 +54,6 @@ namespace Results.Mappings
#endif
#if ORACLE_DB
Map(x => x.WMTypeId);
Map(x => x.WMTypeRev);
#endif
}
}
+25 -7
View File
@@ -28,21 +28,39 @@ namespace Results.Mappings
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
#if IPERL
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
Map(x => x.Q2ErrWOCorrection);
Map(x => x.Q2CorrectionDone);
Map(x => x.Q2Correction);
Map(x => x.Q2CorrRFlow);
Map(x => x.Q2CorrLFlow);
Map(x => x.OrigCalibFactorLNA);
Map(x => x.CalibFactorLNA);
Map(x => x.Q2ErrWOCorrection);
Map(x => x.Q2CorrRL);
Map(x => x.Q2CorrLR);
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 TURA_SPECIAL
Map(x => x.AssignedSerialNr);
Map(x => x.CompleteSerialNr);
Map(x => x.RadioAddress);
Map(x => x.PaletteNr);
Map(x => x.UmkartonNr);
Map(x => x.ProdTestBench);
Map(x => x.ProdWMPosition);
Map(x => x.ProdUserName);
Map(x => x.ProdPurchaseOrder);
Map(x => x.ProdPassed);
Map(x => x.ProdResultCode);
Map(x => x.ProdQ2CorrRL);
Map(x => x.ProdQ2CorrLR);
#endif
#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();
@@ -185,7 +185,7 @@ namespace Results.Output.Printers.Enhanced
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
SizeF tableSize = table0.Measure(e);
int wmSectionHeight = (int)tableSize.Height + 3 * SpacingOne4Header;
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
@@ -239,7 +239,10 @@ namespace Results.Output.Printers.Enhanced
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
{
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
{
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
}
}
nextWMNr += nrWMsOnPage;
@@ -265,7 +268,7 @@ namespace Results.Output.Printers.Enhanced
/// <param name="top">Top coordinate of watermeter data</param>
/// <returns>The height of the printed section</returns>
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
Results.Entities.WaterMeter wm, int printedWMNr, int top)
Results.Entities.WaterMeter wm, int printedWMNr, int top)
{
/// Print the water meter number and the serial number
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
@@ -278,7 +281,14 @@ namespace Results.Output.Printers.Enhanced
Table table = Table.Create_TestsAreRows(wm, testItems, style);
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
if (table.IsEmpty())
{
return top;
}
else
{
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
}
}
@@ -0,0 +1,98 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using Results.Resources;
namespace Results.Output.Printers.Label
{
public class LabelPrintDocument : PrintersCommon
{
/// Size of the printed area without margins, after taking into account 'pageOrientation'
readonly int printHeight;
readonly int printWidth;
/// Selected font
readonly Font font;
/// Data to print
Results.Entities.Batch batch;
LabelPrinterCfg cfg;
Results.Entities.WaterMeter wm;
/// Items to print
IList<WMeterRsltItemSpec> itemsToPrint;
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public LabelPrintDocument(Results.Entities.Batch batch, LabelPrinterCfg cfg, Results.Entities.WaterMeter wm, string documentName)
{
DocumentName = documentName;
this.batch = batch;
this.cfg = cfg;
this.wm = wm;
this.itemsToPrint = Results.WMeterRsltItemSpec.FromStrArray(cfg.ItemsToPrint);
/// Initialize fonts
font = new Font((cfg.FontFamily != null ? cfg.FontFamily : "Arial"),
(cfg.FontSize > 0 ? cfg.FontSize : 10),
(FontStyle)cfg.FontStyle);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
///
printHeight = cfg.PaperHeight;
printWidth = cfg.PaperWidth;
}
/// <summary>
/// Override the default onbeginPrint method of the PrintDocument Object
/// </summary>
/// <param name=e></param>
/// <remarks></remarks>
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
}
/// <summary>
/// Override the default OnPrintPage method of the PrintDocument.
/// </summary>
/// <param name=e></param>
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
/// Run base code
base.OnPrintPage(e);
if (!string.IsNullOrEmpty(cfg.Template))
{
string templatePath = Path.Combine("C:\\TBF\\Templates\\", cfg.Template);
if (File.Exists(templatePath))
{
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), printWidth, printHeight), new Rectangle(0, 0, printWidth, printHeight));
}
}
foreach (var item in itemsToPrint)
{
string[] coords = item.Caption.Split(new char[] { ';' });
int x, y;
if (coords.Length >= 2 && int.TryParse(coords[0].Trim(new char[] { ' ' }), out x)
&& int.TryParse(coords[1].Trim(new char[] { ' ' }), out y))
{
RectangleF printArea = new RectangleF(x, y, printWidth, printHeight);
e.Graphics.DrawString(item.Print(wm), this.font, Brushes.Black, printArea);
}
}
}
}
}
@@ -0,0 +1,21 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
namespace Results.Output.Printers.Label
{
public class LabelPrinterCfg
{
public string Template; /// Full path to a 'png' file
public Config.Entities.PageOrientation PageOrientation;
public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count
public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count
public string[] ItemsToPrint;
public string FontFamily;
public int FontSize;
public int FontStyle;
public System.Globalization.CultureInfo CultureInfo;
public bool GoodOnly;
public bool SupressPrinting; /// true = Bypass printing
}
}
@@ -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);
}
}
}
+23 -4
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
@@ -57,10 +61,21 @@ namespace Results.Output.Printers
}
/// <summary>
/// Returns true when table has either rows or columns count == 0
/// </summary>
/// <returns>true when empty</returns>
public bool IsEmpty()
{
return (Rows == null || RowsCount == 0 || Rows[0] == null || Rows[0].Length == 0);
}
public SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e)
{
SizeF retVal = new SizeF(0, 0);
if (RowsCount == 0) return retVal;
if (IsEmpty()) return retVal; /// Empty table => zero Size
float[] columnWidth = new float[ColumnsCount];
float[] rowHeight = new float[RowsCount];
@@ -117,10 +132,10 @@ namespace Results.Output.Printers
public float Draw(System.Drawing.Printing.PrintPageEventArgs e, float left, float top)
{
if (RowsCount == 0) return top;
if (IsEmpty()) return top; /// Empty table
int tblColumnsCount = Rows[0].Length;
float[] columnWidth = new float[tblColumnsCount];
float[] columnPos = new float[tblColumnsCount];
float[] vertLinePos = new float[tblColumnsCount + 1];
@@ -143,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;
}
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("Results")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2018 Sensus Slovensko, a.s.")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2019 Sensus Slovensko, a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.918.0")]
[assembly: AssemblyFileVersion("2.18.918.0")]
[assembly: AssemblyVersion("2.18.1183.0")]
[assembly: AssemblyFileVersion("2.18.1183.0")]
+126
View File
@@ -69,6 +69,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Address.
/// </summary>
internal static string Address {
get {
return ResourceManager.GetString("Address", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Alignment.
/// </summary>
@@ -105,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>
@@ -123,6 +141,24 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Bench ID.
/// </summary>
internal static string Bench_ID {
get {
return ResourceManager.GetString("Bench_ID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bench name.
/// </summary>
internal static string Bench_name {
get {
return ResourceManager.GetString("Bench_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
@@ -348,6 +384,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to NOK.
/// </summary>
internal static string Failed {
get {
return ResourceManager.GetString("Failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Failed meters count.
/// </summary>
@@ -411,6 +456,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Invalid Q2 correction factors.
/// </summary>
internal static string Invalid_Q2_correction_factors {
get {
return ResourceManager.GetString("Invalid_Q2_correction_factors", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Item.
/// </summary>
@@ -591,6 +645,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
internal static string Passed {
get {
return ResourceManager.GetString("Passed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Passed meters count.
/// </summary>
@@ -627,6 +690,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Previous step is missing or NOK.
/// </summary>
internal static string Previous_step_is_missing_or_NOK {
get {
return ResourceManager.GetString("Previous_step_is_missing_or_NOK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Procedure.
/// </summary>
@@ -636,6 +708,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Procedure description.
/// </summary>
internal static string Procedure_description {
get {
return ResourceManager.GetString("Procedure_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Producer.
/// </summary>
@@ -753,6 +834,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to repetition.
/// </summary>
internal static string repetition {
get {
return ResourceManager.GetString("repetition", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Result.
/// </summary>
@@ -978,6 +1068,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Test in progress.
/// </summary>
internal static string Test_in_progress {
get {
return ResourceManager.GetString("Test_in_progress", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test method.
/// </summary>
@@ -996,6 +1095,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Test repetition count exceeded upper limit.
/// </summary>
internal static string Test_repetition_count_exceeded_upper_limit {
get {
return ResourceManager.GetString("Test_repetition_count_exceeded_upper_limit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test vol..
/// </summary>
@@ -1023,6 +1131,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>
@@ -1860,6 +1977,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Wrong iPerl counting direction.
/// </summary>
internal static string Wrong_iPerl_counting_direction {
get {
return ResourceManager.GetString("Wrong_iPerl_counting_direction", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Year.
/// </summary>
+66
View File
@@ -213,4 +213,70 @@
<data name="Unit" xml:space="preserve">
<value>Jednotka</value>
</data>
<data name="Approval" xml:space="preserve">
<value>Schválení</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Stanice</value>
</data>
<data name="Density" xml:space="preserve">
<value>Hustota</value>
</data>
<data name="Density_correction" xml:space="preserve">
<value>Korekce hustoty</value>
</data>
<data name="End" xml:space="preserve">
<value>Konec</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Procedura</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Popis procedury</value>
</data>
<data name="Start" xml:space="preserve">
<value>Začátek</value>
</data>
<data name="User" xml:space="preserve">
<value>Uživatel</value>
</data>
<data name="User_description" xml:space="preserve">
<value>Popis uživatele</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>ID stanice</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Jméno stanice</value>
</data>
<data name="Address" xml:space="preserve">
<value>Adresa</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Dávka</value>
</data>
<data name="repetition" xml:space="preserve">
<value>opakování</value>
</data>
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
<value>Nesprávne Q2 korekčné faktory</value>
</data>
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
<value>Predchádzajúci krok chýba alebo neprešiel</value>
</data>
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
<value>Počet opakovaní testu prekročil dovolené maximum</value>
</data>
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
<value>Nesprávny smer počítania iPerlu</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
</data>
<data name="Test_in_progress" xml:space="preserve">
<value>Probíhá test</value>
</data>
</root>
+42
View File
@@ -723,4 +723,46 @@
<data name="Unit" xml:space="preserve">
<value>Unit</value>
</data>
<data name="Procedure_description" xml:space="preserve">
<value>Procedure description</value>
</data>
<data name="Bench_ID" xml:space="preserve">
<value>Bench ID</value>
</data>
<data name="Bench_name" xml:space="preserve">
<value>Bench name</value>
</data>
<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>
<data name="repetition" xml:space="preserve">
<value>repetition</value>
</data>
<data name="Invalid_Q2_correction_factors" xml:space="preserve">
<value>Invalid Q2 correction factors</value>
</data>
<data name="Previous_step_is_missing_or_NOK" xml:space="preserve">
<value>Previous step is missing or NOK</value>
</data>
<data name="Test_repetition_count_exceeded_upper_limit" xml:space="preserve">
<value>Test repetition count exceeded upper limit</value>
</data>
<data name="Wrong_iPerl_counting_direction" xml:space="preserve">
<value>Wrong iPerl counting direction</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
</data>
<data name="Test_in_progress" xml:space="preserve">
<value>Test in progress</value>
</data>
</root>
+18 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;FEWA_50</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;MUNICH</DefineConstants>
<DefineConstants>TRACE;FEWA_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -77,6 +77,15 @@
<Compile Include="Forms\ListViewEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\ListViewExtensions.cs" />
<Compile Include="Forms\LviIntColumnComparer.cs" />
<Compile Include="Forms\LviTextColumnComparer.cs" />
<Compile Include="Forms\OneWMResultsCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\OneWMResultsCtrl.Designer.cs">
<DependentUpon>OneWMResultsCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ResultsConfigCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -101,6 +110,10 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Enhanced\EnhancedPrinterCfg.cs" />
<Compile Include="Output\Printers\Label\LabelPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Label\LabelPrinterCfg.cs" />
<Compile Include="Output\Printers\PrintersCommon.cs">
<SubType>Component</SubType>
</Compile>
@@ -152,6 +165,9 @@
<EmbeddedResource Include="Forms\ListViewEx.resx">
<DependentUpon>ListViewEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\OneWMResultsCtrl.resx">
<DependentUpon>OneWMResultsCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfigCtrl.resx">
<DependentUpon>ResultsConfigCtrl.cs</DependentUpon>
</EmbeddedResource>
+19 -4
View File
@@ -31,16 +31,31 @@ namespace Results
}
}
public static string BenchNameFromOracleBenchID(int id)
{
switch (id)
{
case 4: return "WR9";
case 5: return "WR10";
case 6: return "WR11";
case 7: return "PT7";
case 8: return "WR13";
case 9: return "WR15";
case 10: return "WR14";
default: return string.Empty;
}
}
/// <summary>
/// Converts ErrorFlags integer to string. Supports up to 31 flags (E1..E31).
/// Converts ErrorFlags integer to string. Supports up to 31 flags (E1..E31, i.e. bit0..bit30).
/// </summary>
/// <param name="errorFlags">Input</param>
/// <returns>Output string</returns>
public static string ErrorFlagsStr(int errorFlags)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 30; i++)
for (int i = 0; i < 31; i++)
{
if ((errorFlags & (1 << i)) != 0)
{
@@ -54,9 +69,9 @@ namespace Results
public static string PassedColorStr(bool passed, bool useRedGreenColor)
{
#if PUCHONG_PT200
#if PUCHONG_200
return (useRedGreenColor) ? (passed ? "OK|Green" : "NG|Red") : (passed ? "OK|White" : "NG|White");
#elif BAHRAIN_50
#elif BAHRAIN_50 || DUBAJ_50
return (useRedGreenColor) ? (passed ? "PASSED|Green" : "FAILED|Red") : (passed ? "PASSED|White" : "FAILED|White");
#elif LANG_PL
return (useRedGreenColor) ? (passed ? "+|Green" : "-|Red") : (passed ? "+|White" : "-|White");
+108 -40
View File
@@ -144,25 +144,27 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => string.Empty));
/// Common
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Proc_description, Strings.Procedure_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProcedureDescription)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
///
/// 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.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)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd)));
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, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter) : string.Empty)));
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, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef) : string.Empty)));
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, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
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, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
///
/// Mass
@@ -308,12 +310,15 @@ 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)));
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) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_heat_mtr_vol, string.Format("{0} rel.hm.vol. ()", Strings.VName_Error), Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).Error) : string.Empty));
#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
@@ -367,16 +372,22 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per liter ()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
/// Water meters results (combined)
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, string.Format("{0} {1}", Strings.sn, Strings.main), Strings.Tooltip_sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, string.Format("{0} {1}", Strings.sn, Strings.aux), Strings.Tooltip_sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNrAux)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndStateAux)));
/// Batch info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_bench_ID, Strings.Bench, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_ID, Strings.Bench_ID, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_name, Strings.Bench_name, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.TestBenchName) ? w.Batch.TestBenchName : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address1, Strings.Address + " 1", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address1) ? w.Batch.Address1 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address2, Strings.Address + " 2", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address2) ? w.Batch.Address2 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address3, Strings.Address + " 3", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address3) ? w.Batch.Address3 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address4, Strings.Address + " 4", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address4) ? w.Batch.Address4 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address5, Strings.Address + " 5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address5) ? w.Batch.Address5 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.UserNumber)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToUserName(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToFullName(w.Batch.UserName))));
@@ -391,30 +402,55 @@ 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
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : FormatDbl(u, f, p, "F1", (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef) : string.Empty));
#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.Q2CorrRL != 0) || (w.Q2CorrLR != 0)) ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", 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));
#if TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "iPerl assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.AssignedSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "iPerl complete s/n", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.CompleteSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_RadioAddress, "iPerl radio address", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.RadioAddress)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PaletteNr, "iPerl palette nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.PaletteNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UmkartonNr, "iPerl umkarton nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.UmkartonNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_TestBench, "Prod iPerl test bench", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdTestBench)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_WMPosition, "Prod iPerl WM position", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdWMPosition)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UserName, "Prod iPerl user name", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdUserName)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PurchaseOrder, "Prod iPerl purchase order", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdPurchaseOrder)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Passed, "Prod iPerl passed", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => FormatBool(f,w.ProdPassed)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_ResultCode, "Prod iPerl result code", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrRL, "Prod iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrLR, "Prod iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrLR)));
#endif
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));
@@ -431,6 +467,7 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x4000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x8000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E21, "E21 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & 0x100000) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPartStr, "Test part str.", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatEnum(f, (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).TestRslt.Part : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_row_nr, "Table row #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_column_nr, "Table column #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
@@ -444,12 +481,43 @@ namespace Results
public static string FormatStr(string format, string value)
{
return string.IsNullOrEmpty(format) ? value : string.Format(format, value);
string valueEx = string.IsNullOrEmpty(value) ? string.Empty : value;
return string.IsNullOrEmpty(format) ? valueEx : string.Format(format, valueEx);
}
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 FormatEnum(string format, int value)
{
if (string.IsNullOrEmpty(format))
{
return value.ToString();
}
else
{
string[] texts = format.Split(new char[] { '~' });
if (value >= 0 && value < texts.Length)
return texts[value];
else
return value.ToString();
}
}
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)
+66
View File
@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml.Serialization;
using NHibernate;
using Results.Entities;
namespace ResultsBrowser.Filters
{
public class BatchNrFilter : IFilter
{
public static string GetFilterID() { return "BatchNr"; }
public static string GetFilterName() { return "Batch number"; }
///
/// Obligatory wrappers
///
public string GetThisFilterID() { return GetFilterID(); }
public void Save(StringBuilder sb) { (new XmlSerializer(this.GetType())).Serialize(new StringWriter(sb), this); }
public void Data2UI() { userIface.Data2UI(); }
public void UI2Data() { userIface.UI2Data(); }
public UserControl GetFilterUI() { return userIface as UserControl; }
///
/// Serialized filter data
///
public int BatchNr;
private BatchNrFilterUI userIface;
public BatchNrFilter()
{
userIface = new BatchNrFilterUI(this);
}
public IList<WaterMeter> ExecuteQuery(ISession[] sessions, IList<WaterMeter> waterMeters)
{
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
if (waterMeters == null)
{
foreach (var se in sessions)
{
IList<WaterMeter> wms = se.QueryOver<WaterMeter>().List<WaterMeter>();
foreach (var wm in wms)
{
if (wm.BatchNr() == BatchNr) filteredWaterMeters.Add(wm);
}
}
}
else
{
foreach (var wm in waterMeters)
{
if (wm.BatchNr() == BatchNr) filteredWaterMeters.Add(wm);
}
}
return filteredWaterMeters;
}
}
}
+72
View File
@@ -0,0 +1,72 @@
namespace ResultsBrowser.Filters
{
partial class BatchNrFilterUI
{
/// <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.groupBox1 = new System.Windows.Forms.GroupBox();
this.batchNrTextBox = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.batchNrTextBox);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(835, 40);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Batch number";
//
// batchNrTextBox
//
this.batchNrTextBox.Location = new System.Drawing.Point(132, 13);
this.batchNrTextBox.Name = "batchNrTextBox";
this.batchNrTextBox.Size = new System.Drawing.Size(80, 20);
this.batchNrTextBox.TabIndex = 0;
//
// BatchNrFilterUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Name = "BatchNrFilterUI";
this.Size = new System.Drawing.Size(835, 40);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox batchNrTextBox;
}
}
+39
View File
@@ -0,0 +1,39 @@
using System.Windows.Forms;
namespace ResultsBrowser.Filters
{
public partial class BatchNrFilterUI : UserControl
{
BatchNrFilter data;
/// <summary> Used only by Designer </summary>
public BatchNrFilterUI()
{
InitializeComponent();
Localize();
}
/// <summary> Used to create the control aby a filter </summary>
public BatchNrFilterUI(BatchNrFilter data)
{
this.data = data;
InitializeComponent();
Localize();
}
void Localize()
{
groupBox1.Text = BatchNrFilter.GetFilterName();
}
public void Data2UI()
{
batchNrTextBox.Text = data.BatchNr.ToString();
}
public void UI2Data()
{
data.BatchNr = int.Parse(batchNrTextBox.Text);
}
}
}
+18 -10
View File
@@ -18,19 +18,23 @@ namespace ResultsBrowser.Filters
IDs = new string[]
{
DateFilter.GetFilterID(),
BatchNrFilter.GetFilterID(),
ProcedureFilter.GetFilterID(),
ProtocolFilter.GetFilterID(),
QnFilter.GetFilterID(),
SerialNrFilter.GetFilterID(),
WMPositionFilter.GetFilterID(),
};
Names = new string[]
{
DateFilter.GetFilterName(),
BatchNrFilter.GetFilterName(),
ProcedureFilter.GetFilterName(),
ProtocolFilter.GetFilterName(),
QnFilter.GetFilterName(),
SerialNrFilter.GetFilterName(),
WMPositionFilter.GetFilterName(),
};
Count = IDs.Length;
@@ -39,11 +43,13 @@ namespace ResultsBrowser.Filters
public static IFilter GetFilter(string filterID)
{
if (filterID == DateFilter.GetFilterID()) return new DateFilter();
else if (filterID == ProcedureFilter.GetFilterID()) return new ProcedureFilter();
else if (filterID == ProtocolFilter.GetFilterID()) return new ProtocolFilter();
else if (filterID == QnFilter.GetFilterID()) return new QnFilter();
else if (filterID == SerialNrFilter.GetFilterID()) return new SerialNrFilter();
if (filterID == DateFilter.GetFilterID()) return new DateFilter();
else if (filterID == BatchNrFilter.GetFilterID()) return new BatchNrFilter();
else if (filterID == ProcedureFilter.GetFilterID()) return new ProcedureFilter();
else if (filterID == ProtocolFilter.GetFilterID()) return new ProtocolFilter();
else if (filterID == QnFilter.GetFilterID()) return new QnFilter();
else if (filterID == SerialNrFilter.GetFilterID()) return new SerialNrFilter();
else if (filterID == WMPositionFilter.GetFilterID()) return new WMPositionFilter();
else return null;
}
@@ -53,11 +59,13 @@ namespace ResultsBrowser.Filters
try
{
Type type;
if (filterID == DateFilter.GetFilterID()) type = typeof(DateFilter);
else if (filterID == ProcedureFilter.GetFilterID()) type = typeof(ProcedureFilter);
else if (filterID == ProtocolFilter.GetFilterID()) type = typeof(ProtocolFilter);
else if (filterID == QnFilter.GetFilterID()) type = typeof(QnFilter);
else if (filterID == SerialNrFilter.GetFilterID()) type = typeof(SerialNrFilter);
if (filterID == DateFilter.GetFilterID()) type = typeof(DateFilter);
else if (filterID == BatchNrFilter.GetFilterID()) type = typeof(BatchNrFilter);
else if (filterID == ProcedureFilter.GetFilterID()) type = typeof(ProcedureFilter);
else if (filterID == ProtocolFilter.GetFilterID()) type = typeof(ProtocolFilter);
else if (filterID == QnFilter.GetFilterID()) type = typeof(QnFilter);
else if (filterID == SerialNrFilter.GetFilterID()) type = typeof(SerialNrFilter);
else if (filterID == WMPositionFilter.GetFilterID()) type = typeof(WMPositionFilter);
else return null;
IFilter filter = (new XmlSerializer(type)).Deserialize(new StringReader(serializedText)) as IFilter;
+3 -3
View File
@@ -48,15 +48,15 @@
//
this.procedureTextBox.Location = new System.Drawing.Point(132, 13);
this.procedureTextBox.Name = "procedureTextBox";
this.procedureTextBox.Size = new System.Drawing.Size(138, 20);
this.procedureTextBox.Size = new System.Drawing.Size(360, 20);
this.procedureTextBox.TabIndex = 0;
//
// ProcedureFilter
// ProcedureFilterUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Name = "ProcedureFilter";
this.Name = "ProcedureFilterUI";
this.Size = new System.Drawing.Size(835, 40);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
+3 -3
View File
@@ -48,15 +48,15 @@
//
this.procedureTextBox.Location = new System.Drawing.Point(132, 13);
this.procedureTextBox.Name = "procedureTextBox";
this.procedureTextBox.Size = new System.Drawing.Size(138, 20);
this.procedureTextBox.Size = new System.Drawing.Size(80, 20);
this.procedureTextBox.TabIndex = 0;
//
// QnFilter
// QnFilterUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Name = "QnFilter";
this.Name = "QnFilterUI";
this.Size = new System.Drawing.Size(835, 40);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
+34 -6
View File
@@ -30,7 +30,6 @@ namespace ResultsBrowser.Filters
///
public string SerialNr;
private SerialNrFilterUI userIface;
public SerialNrFilter()
@@ -42,21 +41,50 @@ namespace ResultsBrowser.Filters
{
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
if (string.IsNullOrEmpty(SerialNr)) return filteredWaterMeters; /// Empty s/n => Return an empty list of WM-s
IList<string> serialNumbers = new List<string>();
///
if (SerialNr[0] == '@')
{
try
{
TextReader rdr = new StreamReader(SerialNr.Substring(1));
string line = rdr.ReadLine();
while (!string.IsNullOrEmpty(line))
{
serialNumbers.Add(line);
line = rdr.ReadLine();
}
}
catch (Exception)
{
return filteredWaterMeters;
}
}
else
{
serialNumbers.Add(SerialNr);
}
if (waterMeters == null)
{
foreach (var se in sessions)
{
IList<WaterMeter> wms = se.QueryOver<WaterMeter>()
.Where(x => (x.SerialNr == SerialNr))
.List<WaterMeter>();
foreach (var wm in wms) filteredWaterMeters.Add(wm);
foreach (var oneSerialNr in serialNumbers)
{
IList<WaterMeter> wms = se.QueryOver<WaterMeter>()
.Where(x => (x.SerialNr == oneSerialNr))
.List<WaterMeter>();
foreach (var wm in wms) filteredWaterMeters.Add(wm);
}
}
}
else
{
foreach (var wm in waterMeters)
{
if (wm.SerialNr == SerialNr) filteredWaterMeters.Add(wm);
if (serialNumbers.Contains(wm.SerialNr)) filteredWaterMeters.Add(wm);
}
}
+4 -3
View File
@@ -48,15 +48,16 @@
//
this.serialNrTextBox.Location = new System.Drawing.Point(132, 13);
this.serialNrTextBox.Name = "serialNrTextBox";
this.serialNrTextBox.Size = new System.Drawing.Size(138, 20);
this.serialNrTextBox.Size = new System.Drawing.Size(360, 20);
this.serialNrTextBox.TabIndex = 0;
this.serialNrTextBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.serialNrTextBox_MouseDoubleClick);
//
// SerialNrFilter
// SerialNrFilterUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Name = "SerialNrFilter";
this.Name = "SerialNrFilterUI";
this.Size = new System.Drawing.Size(835, 40);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
@@ -35,5 +35,14 @@ namespace ResultsBrowser.Filters
{
data.SerialNr = serialNrTextBox.Text;
}
private void serialNrTextBox_MouseDoubleClick(object sender, MouseEventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
serialNrTextBox.Text = string.Format("@{0}", dlg.FileName);
}
}
}
}
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml.Serialization;
using NHibernate;
using Results.Entities;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Filters
{
public class WMPositionFilter : IFilter
{
public static string GetFilterID() { return "WM_position"; }
public static string GetFilterName() { return "WM Position"; }
///
/// Obligatory wrappers
///
public string GetThisFilterID() { return GetFilterID(); }
public void Save(StringBuilder sb) { (new XmlSerializer(this.GetType())).Serialize(new StringWriter(sb), this); }
public void Data2UI() { userIface.Data2UI(); }
public void UI2Data() { userIface.UI2Data(); }
public UserControl GetFilterUI() { return userIface as UserControl; }
///
/// Serialized filter data
///
public int WMPosition;
private WMPositionFilterUI userIface;
public WMPositionFilter()
{
userIface = new WMPositionFilterUI(this);
}
public IList<WaterMeter> ExecuteQuery(ISession[] sessions, IList<WaterMeter> waterMeters)
{
IList<WaterMeter> filteredWaterMeters = new List<WaterMeter>();
if (waterMeters == null)
{
foreach (var se in sessions)
{
IList<Batch> batches = se.QueryOver<Batch>()
.List<Batch>();
foreach (var b in batches)
{
foreach (var wm in b.WaterMeters) if (wm.WMPosition == this.WMPosition) filteredWaterMeters.Add(wm);
}
}
}
else
{
foreach (var wm in waterMeters)
{
if (wm.WMPosition == this.WMPosition) filteredWaterMeters.Add(wm);
}
}
return filteredWaterMeters;
}
}
}
+72
View File
@@ -0,0 +1,72 @@
namespace ResultsBrowser.Filters
{
partial class WMPositionFilterUI
{
/// <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.groupBox1 = new System.Windows.Forms.GroupBox();
this.wmPositionTextBox = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.wmPositionTextBox);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(835, 40);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "WM Position";
//
// wmPositionTextBox
//
this.wmPositionTextBox.Location = new System.Drawing.Point(132, 13);
this.wmPositionTextBox.Name = "wmPositionTextBox";
this.wmPositionTextBox.Size = new System.Drawing.Size(80, 20);
this.wmPositionTextBox.TabIndex = 0;
//
// WMPositionFilterUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Name = "WMPositionFilterUI";
this.Size = new System.Drawing.Size(835, 40);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox wmPositionTextBox;
}
}
@@ -0,0 +1,47 @@
using System.Windows.Forms;
namespace ResultsBrowser.Filters
{
public partial class WMPositionFilterUI : UserControl
{
WMPositionFilter data;
/// <summary> Used only by Designer </summary>
public WMPositionFilterUI()
{
InitializeComponent();
Localize();
}
/// <summary> Used to create the control aby a filter </summary>
public WMPositionFilterUI(WMPositionFilter data)
{
this.data = data;
InitializeComponent();
Localize();
}
void Localize()
{
groupBox1.Text = WMPositionFilter.GetFilterName();
}
public void Data2UI()
{
wmPositionTextBox.Text = data.WMPosition.ToString();
}
public void UI2Data()
{
int pos;
if (int.TryParse(wmPositionTextBox.Text, out pos) && (pos >= 1) && (pos <= 40))
{
data.WMPosition = pos;
}
else
{
data.WMPosition = 0;
}
}
}
}
+218 -198
View File
@@ -28,204 +28,222 @@
/// </summary>
private void InitializeComponent()
{
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.benchNameTextBox5 = new System.Windows.Forms.TextBox();
this.benchNameTextBox4 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox5 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox4 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 3;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 0;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 1;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 5;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 7;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(506, 250);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 18;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 250);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 19;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 2;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 4;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 6;
//
// languageLabel
//
this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 239);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 14;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageTextBox.Location = new System.Drawing.Point(29, 263);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 15;
//
// formatLabel
//
this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 185);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(94, 13);
this.formatLabel.TabIndex = 12;
this.formatLabel.Text = "Time period format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 207);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 13;
//
// benchNameTextBox5
//
this.benchNameTextBox5.Location = new System.Drawing.Point(29, 149);
this.benchNameTextBox5.Name = "benchNameTextBox5";
this.benchNameTextBox5.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox5.TabIndex = 10;
//
// benchNameTextBox4
//
this.benchNameTextBox4.Location = new System.Drawing.Point(29, 123);
this.benchNameTextBox4.Name = "benchNameTextBox4";
this.benchNameTextBox4.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox4.TabIndex = 8;
//
// connectionStringTextBox5
//
this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 149);
this.connectionStringTextBox5.Name = "connectionStringTextBox5";
this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox5.TabIndex = 11;
//
// connectionStringTextBox4
//
this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 123);
this.connectionStringTextBox4.Name = "connectionStringTextBox4";
this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox4.TabIndex = 9;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 310);
this.Controls.Add(this.benchNameTextBox5);
this.Controls.Add(this.benchNameTextBox4);
this.Controls.Add(this.connectionStringTextBox5);
this.Controls.Add(this.connectionStringTextBox4);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.benchNameTextBox5 = new System.Windows.Forms.TextBox();
this.benchNameTextBox4 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox5 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox4 = new System.Windows.Forms.TextBox();
this.benchNameTextBox6 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox6 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 3;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 23);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 0;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 23);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 1;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 69);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 5;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 93);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 7;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(506, 250);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 18;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 250);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 19;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 2;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 69);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 4;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 93);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 6;
//
// languageLabel
//
this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 245);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 14;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.languageTextBox.Location = new System.Drawing.Point(29, 263);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 15;
//
// formatLabel
//
this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 196);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(94, 13);
this.formatLabel.TabIndex = 12;
this.formatLabel.Text = "Time period format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 215);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 13;
//
// benchNameTextBox5
//
this.benchNameTextBox5.Location = new System.Drawing.Point(29, 141);
this.benchNameTextBox5.Name = "benchNameTextBox5";
this.benchNameTextBox5.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox5.TabIndex = 10;
//
// benchNameTextBox4
//
this.benchNameTextBox4.Location = new System.Drawing.Point(29, 117);
this.benchNameTextBox4.Name = "benchNameTextBox4";
this.benchNameTextBox4.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox4.TabIndex = 8;
//
// connectionStringTextBox5
//
this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 141);
this.connectionStringTextBox5.Name = "connectionStringTextBox5";
this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox5.TabIndex = 11;
//
// connectionStringTextBox4
//
this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 117);
this.connectionStringTextBox4.Name = "connectionStringTextBox4";
this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox4.TabIndex = 9;
//
// benchNameTextBox6
//
this.benchNameTextBox6.Location = new System.Drawing.Point(29, 165);
this.benchNameTextBox6.Name = "benchNameTextBox6";
this.benchNameTextBox6.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox6.TabIndex = 20;
//
// connectionStringTextBox6
//
this.connectionStringTextBox6.Location = new System.Drawing.Point(157, 165);
this.connectionStringTextBox6.Name = "connectionStringTextBox6";
this.connectionStringTextBox6.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox6.TabIndex = 21;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 310);
this.Controls.Add(this.benchNameTextBox6);
this.Controls.Add(this.connectionStringTextBox6);
this.Controls.Add(this.benchNameTextBox5);
this.Controls.Add(this.benchNameTextBox4);
this.Controls.Add(this.connectionStringTextBox5);
this.Controls.Add(this.connectionStringTextBox4);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -249,5 +267,7 @@
private System.Windows.Forms.TextBox benchNameTextBox4;
private System.Windows.Forms.TextBox connectionStringTextBox5;
private System.Windows.Forms.TextBox connectionStringTextBox4;
private System.Windows.Forms.TextBox benchNameTextBox6;
private System.Windows.Forms.TextBox connectionStringTextBox6;
}
}
@@ -22,12 +22,14 @@ namespace ResultsBrowser.Forms
benchNameTextBox3.Text = Program.LocalSettings.Bench3;
benchNameTextBox4.Text = Program.LocalSettings.Bench4;
benchNameTextBox5.Text = Program.LocalSettings.Bench5;
benchNameTextBox6.Text = Program.LocalSettings.Bench6;
connectionStringTextBox1.Text = Program.LocalSettings.ConnectionString1;
connectionStringTextBox2.Text = Program.LocalSettings.ConnectionString2;
connectionStringTextBox3.Text = Program.LocalSettings.ConnectionString3;
connectionStringTextBox4.Text = Program.LocalSettings.ConnectionString4;
connectionStringTextBox5.Text = Program.LocalSettings.ConnectionString5;
connectionStringTextBox6.Text = Program.LocalSettings.ConnectionString6;
timePeriodFormatTextBox.Text = Program.LocalSettings.TimePeriodFormat;
@@ -52,12 +54,14 @@ namespace ResultsBrowser.Forms
Program.LocalSettings.Bench3 = benchNameTextBox3.Text;
Program.LocalSettings.Bench4 = benchNameTextBox4.Text;
Program.LocalSettings.Bench5 = benchNameTextBox5.Text;
Program.LocalSettings.Bench6 = benchNameTextBox6.Text;
Program.LocalSettings.ConnectionString1 = connectionStringTextBox1.Text;
Program.LocalSettings.ConnectionString2 = connectionStringTextBox2.Text;
Program.LocalSettings.ConnectionString3 = connectionStringTextBox3.Text;
Program.LocalSettings.ConnectionString4 = connectionStringTextBox4.Text;
Program.LocalSettings.ConnectionString5 = connectionStringTextBox5.Text;
Program.LocalSettings.ConnectionString6 = connectionStringTextBox6.Text;
Program.LocalSettings.TimePeriodFormat = timePeriodFormatTextBox.Text;
+76
View File
@@ -0,0 +1,76 @@
namespace ResultsBrowser.Forms
{
partial class HistogramCtrl
{
/// <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()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
this.myChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
((System.ComponentModel.ISupportInitialize)(this.myChart)).BeginInit();
this.SuspendLayout();
//
// myChart
//
chartArea1.Name = "ChartArea1";
this.myChart.ChartAreas.Add(chartArea1);
this.myChart.Dock = System.Windows.Forms.DockStyle.Fill;
legend1.Name = "Legend1";
this.myChart.Legends.Add(legend1);
this.myChart.Location = new System.Drawing.Point(0, 0);
this.myChart.Name = "myChart";
this.myChart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Bright;
series1.ChartArea = "ChartArea1";
series1.Legend = "Legend1";
series1.Name = "Series1";
this.myChart.Series.Add(series1);
this.myChart.Size = new System.Drawing.Size(400, 300);
this.myChart.TabIndex = 0;
this.myChart.Text = "chart1";
title1.Name = "Title1";
title1.Text = "Title1";
this.myChart.Titles.Add(title1);
//
// HistogramCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.myChart);
this.Name = "HistogramCtrl";
this.Size = new System.Drawing.Size(400, 300);
((System.ComponentModel.ISupportInitialize)(this.myChart)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataVisualization.Charting.Chart myChart;
}
}
+42
View File
@@ -0,0 +1,42 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace ResultsBrowser.Forms
{
public partial class HistogramCtrl : UserControl
{
/// <summary>
/// Create user control that displays a bar chart iwth custom X-axis labels.
/// </summary>
/// <param name="title">Title of the chart displayed at the top</param>
/// <param name="values">Values = bar lengths</param>
/// <param name="labels">Labels for the X-axis</param>
public HistogramCtrl(string title, double[] values, string[] labels)
{
InitializeComponent();
if (myChart.Titles.Count > 0) myChart.Titles[0].Text = title;
if ((myChart.Series.Count > 0) && (values != null))
{
int startOffset = -1;
int endOffset = 1;
for (int i = 0; i < Math.Min(values.Length + 1, labels.Length); i++)
{
if (i < values.Length) myChart.Series[0].Points.Add(values[i]);
if (!string.IsNullOrEmpty(labels[i]))
{
myChart.ChartAreas[0].AxisX.CustomLabels.Add(new System.Windows.Forms.DataVisualization.Charting.CustomLabel(startOffset, endOffset, labels[i], 0, LabelMarkStyle.None));
}
startOffset = startOffset + 1;
endOffset = endOffset + 1;
}
}
}
}
}
+150
View File
@@ -0,0 +1,150 @@
namespace ResultsBrowser.Forms
{
partial class HistogramDlg
{
/// <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.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.exportButton = new System.Windows.Forms.Button();
this.printButton = new System.Windows.Forms.Button();
this.closeButton = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
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.flowLayoutPanel1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(572, 409);
this.splitContainer1.SplitterDistance = 320;
this.splitContainer1.TabIndex = 0;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.exportButton);
this.splitContainer2.Panel2.Controls.Add(this.printButton);
this.splitContainer2.Panel2.Controls.Add(this.closeButton);
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
this.splitContainer2.SplitterDistance = 249;
this.splitContainer2.TabIndex = 0;
//
// exportButton
//
this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.exportButton.Location = new System.Drawing.Point(103, 21);
this.exportButton.Name = "exportButton";
this.exportButton.Size = new System.Drawing.Size(94, 41);
this.exportButton.TabIndex = 1;
this.exportButton.Text = "Export";
this.exportButton.UseVisualStyleBackColor = true;
//
// printButton
//
this.printButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.printButton.Location = new System.Drawing.Point(4, 21);
this.printButton.Name = "printButton";
this.printButton.Size = new System.Drawing.Size(94, 41);
this.printButton.TabIndex = 0;
this.printButton.Text = "Print";
this.printButton.UseVisualStyleBackColor = true;
//
// closeButton
//
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.closeButton.Location = new System.Drawing.Point(203, 21);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(94, 41);
this.closeButton.TabIndex = 2;
this.closeButton.Text = "Close";
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(572, 320);
this.flowLayoutPanel1.TabIndex = 0;
//
// HistogramDlg
//
this.AcceptButton = this.closeButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(572, 409);
this.Controls.Add(this.splitContainer1);
this.Name = "HistogramDlg";
this.Text = "HistogramDlg";
this.Load += new System.EventHandler(this.HistogramDlg_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.Button closeButton;
private System.Windows.Forms.Button printButton;
private System.Windows.Forms.Button exportButton;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}
+152
View File
@@ -0,0 +1,152 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using Results.Entities;
using ResultsBrowser.Resources;
using ResultsBrowser.Output.Printers.Statistics;
namespace ResultsBrowser.Forms
{
public partial class HistogramDlg : Form
{
const int NrBins = 11;
IList<WaterMeter> waterMeters;
HistogramOptionsDlg options;
public HistogramDlg(IList<WaterMeter> waterMeters, HistogramOptionsDlg options, string title)
{
InitializeComponent();
this.waterMeters = waterMeters;
this.options = options;
Text = title;
closeButton.Text = Strings.OkBtnText;
printButton.Text = Strings.Print;
}
private void HistogramDlg_Load(object sender, EventArgs e)
{
CalculateAndDraw();
}
void CalculateAndDraw()
{
for (int i = 0; i < options.SelectedItems.Count; i++)
{
Results.WMeterRsltItemSpec item = options.SelectedItems[i];
try
{
/// Find minimum and maximum
double min = Double.MaxValue;
double max = Double.MinValue;
double sum = 0;
int count = 0;
foreach (var wm in waterMeters)
{
string strValue = item.Print(wm);
double value;
if (!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out value) &&
!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value))
{
throw new Exception(string.Format("{0} is not a number, cannot calculate histogram", item.Caption));
}
sum += value;
count++;
if (min > value) min = value;
if (max < value) max = value;
}
double mean = (count != 0) ? (sum / count) : 0; /// Prevent division by zero
///
/// Determine limits for bins
///
double[] binHiLim;
string[] labels;
if ((-0.55 <= min) && (max <= 0.55))
{
labels = new string[] { "-0.6", "", "-0.4", "", "-0.2", "", "0", "", "0.2", "", "0.4", "", "0.6" };
binHiLim = new double[] { -0.45, -0.35, -0.25, -0.15, -0.05, 0.05, 0.15, 0.25, 0.35, 0.45, 0.55 };
}
else if ((-1.1 <= min) && (max <= 1.1))
{
labels = new string[] { "-1.2", "", "-0.8", "", "-0.4", "", "0", "", "0.4", "", "0.8", "", "1.2" };
binHiLim = new double[] { -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1 };
}
else if ((-2.2 <= min) && (max <= 2.2))
{
labels = new string[] { "-2.4", "", "-1.6", "", "-0.8", "", "0", "", "0.8", "", "1.6", "", "2.4" };
binHiLim = new double[] { -1.8, -1.4, -1.0, -0.6, -0.2, 0.2, 0.6, 1.0, 1.4, 1.8, 2.2 };
}
else if ((-4.4 <= min) && (max <= 4.4))
{
labels = new string[] { "-4.8", "", "-3.2", "", "-1.6", "", "0", "", "1.6", "", "3.2", "", "4.8" };
binHiLim = new double[] { -3.6, -2.8, -2.0, -1.2, -0.4, 0.4, 1.2, 2.0, 2.8, 3.6, 4.4 };
}
else
{
labels = new string[] { "-9.6", "", "-6.4", "", "-3.2", "", "0", "", "3.2", "", "6.4", "", "9.6" };
binHiLim = new double[] { -7.2, -5.6, -4.0, -2.4, -0.8, 0.8, 2.4, 4.0, 5.6, 7.2, 8.8 };
}
int nrBins = Math.Min(labels.Length - 1, binHiLim.Length + 1);
double[] bins = new double[nrBins];
for (int j = 0; j < nrBins; j++) bins[j] = 0;
/// Calculate bins
foreach (var wm in waterMeters)
{
string strValue = item.Print(wm);
double value;
if (!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.CurrentCulture, out value) &&
!double.TryParse(strValue, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value))
{
throw new Exception(string.Format("{0} is not a number, cannot calculate histogram", item.Caption));
}
for (int j = 0; j < nrBins - 1; j++)
{
if (value < binHiLim[j])
{
bins[j] += 1.0;
break;
}
}
if (value >= binHiLim[nrBins - 2])
{
bins[nrBins - 1] += 1.0;
}
}
///
/// Draw
///
HistogramCtrl histo = new HistogramCtrl(string.Format("{0} mean = {1}", item.Caption, mean.ToString("F3")), bins, labels);
flowLayoutPanel1.Controls.Add(histo);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
private void closeButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
}
}
+91
View File
@@ -0,0 +1,91 @@
namespace ResultsBrowser.Forms
{
partial class HistogramOptionsDlg
{
/// <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.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(380, 302);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 9;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(269, 302);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 8;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(479, 271);
this.flowLayoutPanel1.TabIndex = 10;
//
// HistogramOptionsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(503, 355);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Name = "HistogramOptionsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "HistogramOptionsDlg";
this.Load += new System.EventHandler(this.HistogramOptionsDlg_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}
@@ -0,0 +1,67 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
public partial class HistogramOptionsDlg : Form
{
IList<Results.WMeterRsltItemSpec> items;
public IList<Results.WMeterRsltItemSpec> SelectedItems;
IList<CheckBox> checkBoxes;
public HistogramOptionsDlg(IList<Results.WMeterRsltItemSpec> items)
{
InitializeComponent();
this.items = items;
checkBoxes = new List<CheckBox>();
}
private void HistogramOptionsDlg_Load(object sender, EventArgs e)
{
Localize();
foreach (var item in items)
{
CheckBox cb = new CheckBox();
cb.Text = item.Caption;
cb.Checked = false;
flowLayoutPanel1.Controls.Add(cb);
checkBoxes.Add(cb);
}
}
void Localize()
{
Text = Strings.Statistics;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
private void okButton_Click(object sender, EventArgs e)
{
SelectedItems = new List<Results.WMeterRsltItemSpec>();
for (int i = 0; i < items.Count; i++)
{
if (checkBoxes[i].Checked) SelectedItems.Add(items[i]);
}
//Program.LocalSettings.RowItemCaption = RowItem.Caption;
// ...
//Program.LocalSettings.Save();
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
}
}
}
+83 -70
View File
@@ -28,76 +28,88 @@
/// </summary>
private void InitializeComponent()
{
this.printerClassComboBox = new System.Windows.Forms.ComboBox();
this.changePrinterClassButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.configureButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// printerClassComboBox
//
this.printerClassComboBox.Enabled = false;
this.printerClassComboBox.FormattingEnabled = true;
this.printerClassComboBox.Location = new System.Drawing.Point(12, 29);
this.printerClassComboBox.Name = "printerClassComboBox";
this.printerClassComboBox.Size = new System.Drawing.Size(389, 21);
this.printerClassComboBox.TabIndex = 0;
//
// changePrinterClassButton
//
this.changePrinterClassButton.Location = new System.Drawing.Point(15, 67);
this.changePrinterClassButton.Name = "changePrinterClassButton";
this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43);
this.changePrinterClassButton.TabIndex = 1;
this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)";
this.changePrinterClassButton.UseVisualStyleBackColor = true;
this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Printer type";
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(196, 67);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(95, 43);
this.configureButton.TabIndex = 3;
this.configureButton.Text = "Configure";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// cancelButton
//
this.cancelButton.Location = new System.Drawing.Point(306, 67);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 43);
this.cancelButton.TabIndex = 4;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// PrinterConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(416, 122);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.configureButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.changePrinterClassButton);
this.Controls.Add(this.printerClassComboBox);
this.Name = "PrinterConfigDlg";
this.Text = "Printer configuration";
this.Load += new System.EventHandler(this.PrinterClassDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.printerClassComboBox = new System.Windows.Forms.ComboBox();
this.changePrinterClassButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.configureButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.importButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// printerClassComboBox
//
this.printerClassComboBox.Enabled = false;
this.printerClassComboBox.FormattingEnabled = true;
this.printerClassComboBox.Location = new System.Drawing.Point(12, 29);
this.printerClassComboBox.Name = "printerClassComboBox";
this.printerClassComboBox.Size = new System.Drawing.Size(457, 21);
this.printerClassComboBox.TabIndex = 0;
//
// changePrinterClassButton
//
this.changePrinterClassButton.Location = new System.Drawing.Point(12, 67);
this.changePrinterClassButton.Name = "changePrinterClassButton";
this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43);
this.changePrinterClassButton.TabIndex = 1;
this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)";
this.changePrinterClassButton.UseVisualStyleBackColor = true;
this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Printer type";
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(188, 67);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(83, 43);
this.configureButton.TabIndex = 3;
this.configureButton.Text = "Configure";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// cancelButton
//
this.cancelButton.Location = new System.Drawing.Point(383, 67);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(84, 43);
this.cancelButton.TabIndex = 4;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// importButton
//
this.importButton.Location = new System.Drawing.Point(285, 67);
this.importButton.Name = "importButton";
this.importButton.Size = new System.Drawing.Size(83, 43);
this.importButton.TabIndex = 5;
this.importButton.Text = "Import";
this.importButton.UseVisualStyleBackColor = true;
this.importButton.Click += new System.EventHandler(this.importButton_Click);
//
// PrinterConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(481, 122);
this.Controls.Add(this.importButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.configureButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.changePrinterClassButton);
this.Controls.Add(this.printerClassComboBox);
this.Name = "PrinterConfigDlg";
this.Text = "Printer configuration";
this.Load += new System.EventHandler(this.PrinterClassDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -108,5 +120,6 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button importButton;
}
}
+63 -19
View File
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
@@ -90,7 +92,7 @@ namespace ResultsBrowser.Forms
cfgControl.Config.ItemNr = 0;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
cfgForm.TbfComponents = new List<Config.Entities.Component>();
cfgForm.TbfComponents = new List<Component>();
cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true;
@@ -104,23 +106,65 @@ namespace ResultsBrowser.Forms
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
private void importButton_Click(object sender, EventArgs e)
{
string oriClassName = PrinterClass;
return null;
}
}
OpenFileDialog dlg = new OpenFileDialog();
if (dlg.ShowDialog() != DialogResult.OK) return;
/// Import a procedure from a file
Component newComponent = Component.Import(new StreamReader(dlg.FileName, System.Text.Encoding.UTF8));
bool classIsOK = false;
foreach (var pc in printerFactories)
{
if (newComponent.ClassName == pc.ClassName) { classIsOK = true; break; }
}
if (classIsOK)
{
printerClassComboBox.Text = newComponent.ClassName;
IComponentCfg printerCfg = TbfComponents.CmpntCfgFromCmpntEntity(newComponent);
if (printerCfg != null)
{
PrinterClass = newComponent.ClassName;
PrinterCfg = printerCfg.CreateDbEntity().Parameters;
DialogResult = DialogResult.OK;
Close();
}
else
{
MessageBox.Show("Importing printer configuration failed, file is corrupt.");
return;
}
}
else
{
MessageBox.Show("Invalid class of the imported component.");
return;
}
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null;
}
}
}
+27 -68
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Results.Entities;
@@ -11,22 +14,7 @@ namespace ResultsBrowser.Forms
public partial class StatisticsDlg : Form
{
IList<WaterMeter> waterMeters;
bool twoDim;
Results.WMeterRsltItemSpec rowItem;
Results.WMeterRsltItemSpec rowItem2;
Results.WMeterRsltItemSpec rowItem3;
Results.WMeterRsltItemSpec columnItem;
Results.WMeterRsltItemSpec columnItem2;
Results.WMeterRsltItemSpec columnItem3;
string rowTestSpec;
string rowTestSpec2;
string rowTestSpec3;
string columnTestSpec;
string columnTestSpec2;
string columnTestSpec3;
StatisticsOptionsDlg options;
IList<string> rowValues;
IList<string> columnValues;
@@ -36,23 +24,14 @@ namespace ResultsBrowser.Forms
string title;
public StatisticsDlg(IList<WaterMeter> waterMeters, bool twoDim,
Results.WMeterRsltItemSpec rowItem,
Results.WMeterRsltItemSpec rowItem2,
Results.WMeterRsltItemSpec rowItem3,
Results.WMeterRsltItemSpec columnItem,
Results.WMeterRsltItemSpec columnItem2,
Results.WMeterRsltItemSpec columnItem3,
string rowTestSpec,
string rowTestSpec2,
string rowTestSpec3,
string columnTestSpec,
string columnTestSpec2,
string columnTestSpec3,
public StatisticsDlg(IList<WaterMeter> waterMeters, StatisticsOptionsDlg options,
DateTime startDate, DateTime endDate)
{
InitializeComponent();
this.waterMeters = waterMeters;
this.options = options;
if (!string.IsNullOrEmpty(Program.LocalSettings.TimePeriodFormat) && (startDate != new DateTime(0)) && (endDate != new DateTime(0)))
{
title = string.Format(Program.LocalSettings.TimePeriodFormat, startDate, endDate);
@@ -66,26 +45,6 @@ namespace ResultsBrowser.Forms
closeButton.Text = Strings.OkBtnText;
printButton.Text = Strings.Print;
this.waterMeters = waterMeters;
this.twoDim = twoDim;
this.rowItem = rowItem;
this.rowItem2 = rowItem2;
this.rowItem3 = rowItem3;
this.columnItem = columnItem;
this.columnItem2 = columnItem2;
this.columnItem3 = columnItem3;
this.rowTestSpec = rowTestSpec;
this.rowTestSpec2 = rowTestSpec2;
this.rowTestSpec3 = rowTestSpec3;
this.columnTestSpec = columnTestSpec;
this.columnTestSpec2 = columnTestSpec2;
this.columnTestSpec3 = columnTestSpec3;
}
private void StatisticsDlg_Load(object sender, EventArgs e)
@@ -105,16 +64,16 @@ namespace ResultsBrowser.Forms
///
foreach (var wm in waterMeters)
{
string value = rowItem.Print(wm);
if (rowItem2 != null) value = value + " | " + rowItem2.Print(wm);
if (rowItem3 != null) value = value + " | " + rowItem3.Print(wm);
string value = options.RowItem.Print(wm);
if (options.RowItem2 != null) value = value + " | " + options.RowItem2.Print(wm);
if (options.RowItem3 != null) value = value + " | " + options.RowItem3.Print(wm);
if (!rowValues.Contains(value)) rowValues.Add(value);
if (twoDim)
if (options.TwoDim)
{
value = columnItem.Print(wm);
if (columnItem2 != null) value = value + " | " + columnItem2.Print(wm);
if (columnItem3 != null) value = value + " | " + columnItem3.Print(wm);
value = options.ColumnItem.Print(wm);
if (options.ColumnItem2 != null) value = value + " | " + options.ColumnItem2.Print(wm);
if (options.ColumnItem3 != null) value = value + " | " + options.ColumnItem3.Print(wm);
if (!columnValues.Contains(value)) columnValues.Add(value);
}
}
@@ -129,17 +88,17 @@ namespace ResultsBrowser.Forms
{
for (int row = 0; row < rowValues.Count; row++)
{
string rowValue = rowItem.Print(wm);
if (rowItem2 != null) rowValue = rowValue + " | " + rowItem2.Print(wm);
if (rowItem3 != null) rowValue = rowValue + " | " + rowItem3.Print(wm);
string rowValue = options.RowItem.Print(wm);
if (options.RowItem2 != null) rowValue = rowValue + " | " + options.RowItem2.Print(wm);
if (options.RowItem3 != null) rowValue = rowValue + " | " + options.RowItem3.Print(wm);
if (twoDim)
if (options.TwoDim)
{
for (int column = 0; column < columnsCount; column++)
{
string columnValue = columnItem.Print(wm);
if (columnItem2 != null) columnValue = columnValue + " | " + columnItem2.Print(wm);
if (columnItem3 != null) columnValue = columnValue + " | " + columnItem3.Print(wm);
string columnValue = options.ColumnItem.Print(wm);
if (options.ColumnItem2 != null) columnValue = columnValue + " | " + options.ColumnItem2.Print(wm);
if (options.ColumnItem3 != null) columnValue = columnValue + " | " + options.ColumnItem3.Print(wm);
if (rowValue == rowValues[row] && columnValue == columnValues[column])
{
@@ -164,7 +123,7 @@ namespace ResultsBrowser.Forms
statisticsListView.Columns.Add(" ", 200);
for (int column = 0; column < columnsCount; column++)
{
statisticsListView.Columns.Add((twoDim ? columnValues[column] : Strings.Count), 70);
statisticsListView.Columns.Add((options.TwoDim ? columnValues[column] : Strings.Count), 70);
}
for (int row = 0; row < rowValues.Count; row++)
@@ -197,7 +156,7 @@ namespace ResultsBrowser.Forms
table[0, 0] = string.Empty;
for (int column = 0; column < columnsCount; column++)
{
table[0, column + 1] = (twoDim ? columnValues[column] : Strings.Count);
table[0, column + 1] = (options.TwoDim ? columnValues[column] : Strings.Count);
}
for (int row = 0; row < rowValues.Count; row++)
@@ -234,7 +193,7 @@ namespace ResultsBrowser.Forms
{
using (TextWriter writer = new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8))
{
if (twoDim)
if (options.TwoDim)
{
/// Write column headers
for (int i = 0; i < columnValues.Count; i++)
@@ -245,7 +204,7 @@ namespace ResultsBrowser.Forms
}
else
{
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", rowItem.Caption, Strings.Count));
writer.WriteLine(string.Format("\"{0}\";\"{1}\"", options.RowItem.Caption, Strings.Count));
}
int nrColumns = Math.Max(1, columnValues.Count);
+4 -1
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ResultsBrowser.Resources;
+19 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
@@ -29,6 +29,7 @@ namespace ResultsBrowser
public string Bench3;
public string Bench4;
public string Bench5;
public string Bench6;
/// Database settings of servers.
public string ConnectionString1;
@@ -36,12 +37,14 @@ namespace ResultsBrowser
public string ConnectionString3;
public string ConnectionString4;
public string ConnectionString5;
public string ConnectionString6;
public bool Bench1Selected;
public bool Bench2Selected;
public bool Bench3Selected;
public bool Bench4Selected;
public bool Bench5Selected;
public bool Bench6Selected;
public string TimePeriodFormat;
@@ -106,6 +109,21 @@ namespace ResultsBrowser
public LocalSettings()
{
#if TURA_IPERL || TURA_SPECIAL
Bench1 = "WR10";
Bench2 = "WR11";
Bench3 = "WR13";
Bench4 = "WR14";
Bench5 = "WR15";
Bench6 = "PT7";
ConnectionString1 = "SERVER=10.42.128.93; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;";
ConnectionString2 = "SERVER=10.42.128.102; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;";
ConnectionString3 = "SERVER=10.42.128.89; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;";
ConnectionString4 = "SERVER=10.42.128.213; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;";
ConnectionString5 = "SERVER=10.42.128.214; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;";
ConnectionString6 = "SERVER=10.42.129.26; DATABASE=iperlspecial-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;";
Language = "SK";
#endif
}
/// <summary>
+27 -29
View File
@@ -14,25 +14,26 @@ namespace ResultsBrowser
{
public class Program
{
static ILog log; /// log4net
/// Program information
public static string Version; /// version string
public static DateTime BuildDateTime; /// date and time of program build
/// Local settings
public static readonly string ExecutableDirectory;
public static readonly string ConfigDirectory;
public static readonly string LogDirectory;
public static readonly string LocalSettingsFileName;
public static readonly string LocalSettingsBackupName;
public static string ExecutableDirectory;
public static string ConfigDirectory;
public static string LogDirectory;
public static string LocalSettingsFileName;
public static string LocalSettingsBackupName;
public static LocalSettings LocalSettings;
public static System.Globalization.CultureInfo AltCulture;
static readonly ILog log; /// log4net
static Program()
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
/// Program version string
System.Reflection.Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
Version ver = thisAssembly.GetName().Version;
@@ -41,26 +42,26 @@ namespace ResultsBrowser
/// Local program configuration directory including the trailing backslash
ExecutableDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
ConfigDirectory = Path.Combine(ExecutableDirectory, "..\\Cfg\\");
#if false
/// Config directory is a sibling directory of the executable directory
ConfigDirectory = Path.Combine(ExecutableDirectory, "..", string.Format("Cfg{0}", (args.Length >= 1) ? args[0] : string.Empty));
LogDirectory = Path.Combine(ExecutableDirectory, "..\\Log\\");
LocalSettingsFileName = ConfigDirectory + "config.xml";
LocalSettingsBackupName = ConfigDirectory + "config.backup.xml";
#else
/// Config directory is a directory in 'C:\Users\username\AppData\Local' folder
ConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
string.Format("ResultsBrowser{0}", (args.Length >= 1) ? args[0] : string.Empty));
LogDirectory = "C:\\Temp\\ResultsBrowserLog\\";
#endif
LocalSettingsFileName = Path.Combine(ConfigDirectory, "config.xml");
LocalSettingsBackupName = Path.Combine(ConfigDirectory, "config.backup.xml");
/// Configue and start logging
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(ConfigDirectory + "log4netConfig.xml"));
log = LogManager.GetLogger(typeof(Program));
log.Fatal("------------------------------------------------------------------------------------------------");
log.Fatal("started");
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
///
///
/// Load the local settings
///
LocalSettings = LocalSettings.Load(Program.LocalSettingsFileName);
@@ -93,7 +94,7 @@ namespace ResultsBrowser
try
{
string culture = LocalSettings.Language.Replace('_', '-');
string culture = (LocalSettings.Language != null) ? LocalSettings.Language.Replace('_', '-') : "EN";
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
}
catch (Exception e)
@@ -107,9 +108,6 @@ namespace ResultsBrowser
new System.Globalization.CultureInfo("en");
}
//AltCulture = null;
AltCulture = new System.Globalization.CultureInfo("SK");
/// This belongs to Application.Run(new MainWnd()) ...
/// and should be executed before opening 'loginDlg'
+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.856.0")]
[assembly: AssemblyFileVersion("2.18.856.0")]
[assembly: AssemblyVersion("2.18.1146.0")]
[assembly: AssemblyFileVersion("2.18.1146.0")]
+6
View File
@@ -237,4 +237,10 @@
<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>
<data name="Histograms" xml:space="preserve">
<value>Histogramy</value>
</data>
</root>
+6
View File
@@ -825,4 +825,10 @@
<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>
<data name="Histograms" xml:space="preserve">
<value>Histograms</value>
</data>
</root>
+18
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>
@@ -1248,6 +1257,15 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Histograms.
/// </summary>
internal static string Histograms {
get {
return ResourceManager.GetString("Histograms", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Horizontally.
/// </summary>
+50 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;FEWA_50</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;MUNICH</DefineConstants>
<DefineConstants>TRACE;FEWA_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -60,6 +60,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -70,6 +71,13 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Filters\BatchNrFilter.cs" />
<Compile Include="Filters\BatchNrFilterUI.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Filters\BatchNrFilterUI.designer.cs">
<DependentUpon>BatchNrFilterUI.cs</DependentUpon>
</Compile>
<Compile Include="Filters\DateFilterUI.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -107,6 +115,13 @@
<Compile Include="Filters\SerialNrFilterUI.Designer.cs">
<DependentUpon>SerialNrFilterUI.cs</DependentUpon>
</Compile>
<Compile Include="Filters\WMPositionFilter.cs" />
<Compile Include="Filters\WMPositionFilterUI.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Filters\WMPositionFilterUI.designer.cs">
<DependentUpon>WMPositionFilterUI.cs</DependentUpon>
</Compile>
<Compile Include="Forms\AddFilterDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -119,6 +134,24 @@
<Compile Include="Forms\DatabaseSettingsDlg.Designer.cs">
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\HistogramCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\HistogramCtrl.Designer.cs">
<DependentUpon>HistogramCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\HistogramDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\HistogramDlg.Designer.cs">
<DependentUpon>HistogramDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\HistogramOptionsDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\HistogramOptionsDlg.Designer.cs">
<DependentUpon>HistogramOptionsDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\NoBenchOrDatabaseDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -161,6 +194,9 @@
<Compile Include="ResultsBrowserWnd.Designer.cs">
<DependentUpon>ResultsBrowserWnd.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Filters\BatchNrFilterUI.resx">
<DependentUpon>BatchNrFilterUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Filters\DateFilterUI.resx">
<DependentUpon>DateFilterUI.cs</DependentUpon>
</EmbeddedResource>
@@ -176,12 +212,24 @@
<EmbeddedResource Include="Filters\SerialNrFilterUI.resx">
<DependentUpon>SerialNrFilterUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Filters\WMPositionFilterUI.resx">
<DependentUpon>WMPositionFilterUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AddFilterDlg.resx">
<DependentUpon>AddFilterDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\DatabaseSettingsDlg.resx">
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\HistogramCtrl.resx">
<DependentUpon>HistogramCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\HistogramDlg.resx">
<DependentUpon>HistogramDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\HistogramOptionsDlg.resx">
<DependentUpon>HistogramOptionsDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\NoBenchOrDatabaseDlg.resx">
<DependentUpon>NoBenchOrDatabaseDlg.cs</DependentUpon>
</EmbeddedResource>
+387 -331
View File
@@ -28,337 +28,389 @@
/// </summary>
private void InitializeComponent()
{
this.vSplitContainer = new System.Windows.Forms.SplitContainer();
this.hSplitContainer = new System.Windows.Forms.SplitContainer();
this.filtersGroupBox = new System.Windows.Forms.GroupBox();
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
this.resultsListView = new System.Windows.Forms.ListView();
this.printerConfigBtn = new System.Windows.Forms.Button();
this.statisticsBtn = new System.Windows.Forms.Button();
this.printQueryResultsBtn = new System.Windows.Forms.Button();
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
this.formatOfResultsBtn = new System.Windows.Forms.Button();
this.clearFiltersBtn = new System.Windows.Forms.Button();
this.settingsBtn = new System.Windows.Forms.Button();
this.saveConfigBtn = new System.Windows.Forms.Button();
this.loadConfigBtn = new System.Windows.Forms.Button();
this.executeQueryBtn = new System.Windows.Forms.Button();
this.addFilterBtn = new System.Windows.Forms.Button();
this.testBenchesGroupBox = new System.Windows.Forms.GroupBox();
this.checkBox5 = new System.Windows.Forms.RadioButton();
this.checkBox4 = new System.Windows.Forms.RadioButton();
this.checkBox3 = new System.Windows.Forms.RadioButton();
this.checkBox2 = new System.Windows.Forms.RadioButton();
this.checkBox1 = new System.Windows.Forms.RadioButton();
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).BeginInit();
this.vSplitContainer.Panel1.SuspendLayout();
this.vSplitContainer.Panel2.SuspendLayout();
this.vSplitContainer.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).BeginInit();
this.hSplitContainer.Panel1.SuspendLayout();
this.hSplitContainer.Panel2.SuspendLayout();
this.hSplitContainer.SuspendLayout();
this.filtersGroupBox.SuspendLayout();
this.resultsGroupBox.SuspendLayout();
this.testBenchesGroupBox.SuspendLayout();
this.SuspendLayout();
//
// vSplitContainer
//
this.vSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.vSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.vSplitContainer.Location = new System.Drawing.Point(0, 0);
this.vSplitContainer.Name = "vSplitContainer";
//
// vSplitContainer.Panel1
//
this.vSplitContainer.Panel1.Controls.Add(this.hSplitContainer);
this.vSplitContainer.Panel1MinSize = 100;
//
// vSplitContainer.Panel2
//
this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.saveConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.loadConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.executeQueryBtn);
this.vSplitContainer.Panel2.Controls.Add(this.addFilterBtn);
this.vSplitContainer.Panel2.Controls.Add(this.testBenchesGroupBox);
this.vSplitContainer.Panel2MinSize = 100;
this.vSplitContainer.Size = new System.Drawing.Size(984, 712);
this.vSplitContainer.SplitterDistance = 840;
this.vSplitContainer.TabIndex = 0;
//
// hSplitContainer
//
this.hSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.hSplitContainer.Location = new System.Drawing.Point(0, 0);
this.hSplitContainer.Name = "hSplitContainer";
this.hSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// hSplitContainer.Panel1
//
this.hSplitContainer.Panel1.Controls.Add(this.filtersGroupBox);
//
// hSplitContainer.Panel2
//
this.hSplitContainer.Panel2.Controls.Add(this.resultsGroupBox);
this.hSplitContainer.Size = new System.Drawing.Size(840, 712);
this.hSplitContainer.SplitterDistance = 280;
this.hSplitContainer.TabIndex = 0;
//
// filtersGroupBox
//
this.filtersGroupBox.Controls.Add(this.filtersFlowLayoutPanel);
this.filtersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersGroupBox.Location = new System.Drawing.Point(0, 0);
this.filtersGroupBox.Name = "filtersGroupBox";
this.filtersGroupBox.Size = new System.Drawing.Size(840, 280);
this.filtersGroupBox.TabIndex = 1;
this.filtersGroupBox.TabStop = false;
this.filtersGroupBox.Text = "Filters";
//
// filtersFlowLayoutPanel
//
this.filtersFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersFlowLayoutPanel.Location = new System.Drawing.Point(3, 16);
this.filtersFlowLayoutPanel.Name = "filtersFlowLayoutPanel";
this.filtersFlowLayoutPanel.Size = new System.Drawing.Size(834, 261);
this.filtersFlowLayoutPanel.TabIndex = 0;
//
// resultsGroupBox
//
this.resultsGroupBox.Controls.Add(this.resultsListView);
this.resultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsGroupBox.Location = new System.Drawing.Point(0, 0);
this.resultsGroupBox.Name = "resultsGroupBox";
this.resultsGroupBox.Size = new System.Drawing.Size(840, 428);
this.resultsGroupBox.TabIndex = 1;
this.resultsGroupBox.TabStop = false;
this.resultsGroupBox.Text = "Query results";
//
// resultsListView
//
this.resultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsListView.Location = new System.Drawing.Point(3, 16);
this.resultsListView.Name = "resultsListView";
this.resultsListView.Size = new System.Drawing.Size(834, 409);
this.resultsListView.TabIndex = 0;
this.resultsListView.UseCompatibleStateImageBehavior = false;
this.resultsListView.View = System.Windows.Forms.View.Details;
//
// printerConfigBtn
//
this.printerConfigBtn.Location = new System.Drawing.Point(8, 316);
this.printerConfigBtn.Name = "printerConfigBtn";
this.printerConfigBtn.Size = new System.Drawing.Size(125, 35);
this.printerConfigBtn.TabIndex = 11;
this.printerConfigBtn.Text = "Configure printer";
this.printerConfigBtn.UseVisualStyleBackColor = true;
this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click);
//
// statisticsBtn
//
this.statisticsBtn.Location = new System.Drawing.Point(8, 621);
this.statisticsBtn.Name = "statisticsBtn";
this.statisticsBtn.Size = new System.Drawing.Size(125, 35);
this.statisticsBtn.TabIndex = 10;
this.statisticsBtn.Text = "Statistics";
this.statisticsBtn.UseVisualStyleBackColor = true;
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 548);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
this.printQueryResultsBtn.TabIndex = 9;
this.printQueryResultsBtn.Text = "Print query results";
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 508);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 35);
this.exportQueryResultsBtn.TabIndex = 8;
this.exportQueryResultsBtn.Text = "Export query results";
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 35);
this.formatOfResultsBtn.TabIndex = 7;
this.formatOfResultsBtn.Text = "Configure output";
this.formatOfResultsBtn.UseVisualStyleBackColor = true;
this.formatOfResultsBtn.Click += new System.EventHandler(this.formatOfResultsBtn_Click);
//
// clearFiltersBtn
//
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196);
this.clearFiltersBtn.Name = "clearFiltersBtn";
this.clearFiltersBtn.Size = new System.Drawing.Size(125, 35);
this.clearFiltersBtn.TabIndex = 2;
this.clearFiltersBtn.Text = "Clear filters";
this.clearFiltersBtn.UseVisualStyleBackColor = true;
this.clearFiltersBtn.Click += new System.EventHandler(this.clearFiltersBtn_Click);
//
// settingsBtn
//
this.settingsBtn.Location = new System.Drawing.Point(8, 12);
this.settingsBtn.Name = "settingsBtn";
this.settingsBtn.Size = new System.Drawing.Size(125, 33);
this.settingsBtn.TabIndex = 0;
this.settingsBtn.Text = "Settings";
this.settingsBtn.UseVisualStyleBackColor = true;
this.settingsBtn.Click += new System.EventHandler(this.settingsBtn_Click);
//
// saveConfigBtn
//
this.saveConfigBtn.Location = new System.Drawing.Point(8, 356);
this.saveConfigBtn.Name = "saveConfigBtn";
this.saveConfigBtn.Size = new System.Drawing.Size(125, 35);
this.saveConfigBtn.TabIndex = 5;
this.saveConfigBtn.Text = "Save configuration";
this.saveConfigBtn.UseVisualStyleBackColor = true;
this.saveConfigBtn.Click += new System.EventHandler(this.saveConfigBtn_Click);
//
// loadConfigBtn
//
this.loadConfigBtn.Location = new System.Drawing.Point(8, 396);
this.loadConfigBtn.Name = "loadConfigBtn";
this.loadConfigBtn.Size = new System.Drawing.Size(125, 35);
this.loadConfigBtn.TabIndex = 4;
this.loadConfigBtn.Text = "Load configuration";
this.loadConfigBtn.UseVisualStyleBackColor = true;
this.loadConfigBtn.Click += new System.EventHandler(this.loadConfigBtn_Click);
//
// executeQueryBtn
//
this.executeQueryBtn.Location = new System.Drawing.Point(8, 468);
this.executeQueryBtn.Name = "executeQueryBtn";
this.executeQueryBtn.Size = new System.Drawing.Size(125, 35);
this.executeQueryBtn.TabIndex = 6;
this.executeQueryBtn.Text = "Execute query";
this.executeQueryBtn.UseVisualStyleBackColor = true;
this.executeQueryBtn.Click += new System.EventHandler(this.executeQueryBtn_Click);
//
// addFilterBtn
//
this.addFilterBtn.Location = new System.Drawing.Point(8, 236);
this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(125, 35);
this.addFilterBtn.TabIndex = 3;
this.addFilterBtn.Text = "Add filter";
this.addFilterBtn.UseVisualStyleBackColor = true;
this.addFilterBtn.Click += new System.EventHandler(this.addFilterBtn_Click);
//
// testBenchesGroupBox
//
this.testBenchesGroupBox.Controls.Add(this.checkBox5);
this.testBenchesGroupBox.Controls.Add(this.checkBox4);
this.testBenchesGroupBox.Controls.Add(this.checkBox3);
this.testBenchesGroupBox.Controls.Add(this.checkBox2);
this.testBenchesGroupBox.Controls.Add(this.checkBox1);
this.testBenchesGroupBox.Location = new System.Drawing.Point(8, 54);
this.testBenchesGroupBox.Name = "testBenchesGroupBox";
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 135);
this.testBenchesGroupBox.TabIndex = 1;
this.testBenchesGroupBox.TabStop = false;
this.testBenchesGroupBox.Text = "Test benches";
//
// checkBox5
//
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(23, 106);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(85, 17);
this.checkBox5.TabIndex = 4;
this.checkBox5.TabStop = true;
this.checkBox5.Text = "radioButton5";
this.checkBox5.UseVisualStyleBackColor = true;
this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
//
// checkBox4
//
this.checkBox4.AutoSize = true;
this.checkBox4.Location = new System.Drawing.Point(23, 86);
this.checkBox4.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(85, 17);
this.checkBox4.TabIndex = 3;
this.checkBox4.TabStop = true;
this.checkBox4.Text = "radioButton4";
this.checkBox4.UseVisualStyleBackColor = true;
this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
//
// checkBox3
//
this.checkBox3.AutoSize = true;
this.checkBox3.Location = new System.Drawing.Point(23, 65);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
this.checkBox3.TabStop = true;
this.checkBox3.Text = "radioButton3";
this.checkBox3.UseVisualStyleBackColor = true;
this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(23, 44);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(85, 17);
this.checkBox2.TabIndex = 1;
this.checkBox2.TabStop = true;
this.checkBox2.Text = "radioButton2";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(23, 23);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(85, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.TabStop = true;
this.checkBox1.Text = "radioButton1";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// ResultsBrowserWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 712);
this.Controls.Add(this.vSplitContainer);
this.Name = "ResultsBrowserWnd";
this.Text = "Results Browser";
this.Load += new System.EventHandler(this.ResultsBrowserWnd_Load);
this.vSplitContainer.Panel1.ResumeLayout(false);
this.vSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).EndInit();
this.vSplitContainer.ResumeLayout(false);
this.hSplitContainer.Panel1.ResumeLayout(false);
this.hSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).EndInit();
this.hSplitContainer.ResumeLayout(false);
this.filtersGroupBox.ResumeLayout(false);
this.resultsGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.PerformLayout();
this.ResumeLayout(false);
this.vSplitContainer = new System.Windows.Forms.SplitContainer();
this.hSplitContainer = new System.Windows.Forms.SplitContainer();
this.filtersGroupBox = new System.Windows.Forms.GroupBox();
this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.resultsGroupBox = new System.Windows.Forms.GroupBox();
this.resultsListView = new System.Windows.Forms.ListView();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.histogramBtn = new System.Windows.Forms.Button();
this.statisticsBtn = new System.Windows.Forms.Button();
this.outputGroupBox = new System.Windows.Forms.GroupBox();
this.exportQueryResultsBtn = new System.Windows.Forms.Button();
this.printQueryResultsBtn = new System.Windows.Forms.Button();
this.printerConfigBtn = new System.Windows.Forms.Button();
this.formatOfResultsBtn = new System.Windows.Forms.Button();
this.clearFiltersBtn = new System.Windows.Forms.Button();
this.settingsBtn = new System.Windows.Forms.Button();
this.saveConfigBtn = new System.Windows.Forms.Button();
this.loadConfigBtn = new System.Windows.Forms.Button();
this.executeQueryBtn = new System.Windows.Forms.Button();
this.addFilterBtn = new System.Windows.Forms.Button();
this.testBenchesGroupBox = new System.Windows.Forms.GroupBox();
this.checkBox6 = new System.Windows.Forms.RadioButton();
this.checkBox5 = new System.Windows.Forms.RadioButton();
this.checkBox4 = new System.Windows.Forms.RadioButton();
this.checkBox3 = new System.Windows.Forms.RadioButton();
this.checkBox2 = new System.Windows.Forms.RadioButton();
this.checkBox1 = new System.Windows.Forms.RadioButton();
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).BeginInit();
this.vSplitContainer.Panel1.SuspendLayout();
this.vSplitContainer.Panel2.SuspendLayout();
this.vSplitContainer.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).BeginInit();
this.hSplitContainer.Panel1.SuspendLayout();
this.hSplitContainer.Panel2.SuspendLayout();
this.hSplitContainer.SuspendLayout();
this.filtersGroupBox.SuspendLayout();
this.resultsGroupBox.SuspendLayout();
this.groupBox1.SuspendLayout();
this.outputGroupBox.SuspendLayout();
this.testBenchesGroupBox.SuspendLayout();
this.SuspendLayout();
//
// vSplitContainer
//
this.vSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.vSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.vSplitContainer.Location = new System.Drawing.Point(0, 0);
this.vSplitContainer.Name = "vSplitContainer";
//
// vSplitContainer.Panel1
//
this.vSplitContainer.Panel1.Controls.Add(this.hSplitContainer);
this.vSplitContainer.Panel1MinSize = 100;
//
// vSplitContainer.Panel2
//
this.vSplitContainer.Panel2.Controls.Add(this.groupBox1);
this.vSplitContainer.Panel2.Controls.Add(this.outputGroupBox);
this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn);
this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn);
this.vSplitContainer.Panel2.Controls.Add(this.saveConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.loadConfigBtn);
this.vSplitContainer.Panel2.Controls.Add(this.executeQueryBtn);
this.vSplitContainer.Panel2.Controls.Add(this.addFilterBtn);
this.vSplitContainer.Panel2.Controls.Add(this.testBenchesGroupBox);
this.vSplitContainer.Panel2MinSize = 100;
this.vSplitContainer.Size = new System.Drawing.Size(984, 712);
this.vSplitContainer.SplitterDistance = 840;
this.vSplitContainer.TabIndex = 0;
//
// hSplitContainer
//
this.hSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.hSplitContainer.Location = new System.Drawing.Point(0, 0);
this.hSplitContainer.Name = "hSplitContainer";
this.hSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// hSplitContainer.Panel1
//
this.hSplitContainer.Panel1.Controls.Add(this.filtersGroupBox);
//
// hSplitContainer.Panel2
//
this.hSplitContainer.Panel2.Controls.Add(this.resultsGroupBox);
this.hSplitContainer.Size = new System.Drawing.Size(840, 712);
this.hSplitContainer.SplitterDistance = 280;
this.hSplitContainer.TabIndex = 0;
//
// filtersGroupBox
//
this.filtersGroupBox.Controls.Add(this.filtersFlowLayoutPanel);
this.filtersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersGroupBox.Location = new System.Drawing.Point(0, 0);
this.filtersGroupBox.Name = "filtersGroupBox";
this.filtersGroupBox.Size = new System.Drawing.Size(840, 280);
this.filtersGroupBox.TabIndex = 1;
this.filtersGroupBox.TabStop = false;
this.filtersGroupBox.Text = "Filters";
//
// filtersFlowLayoutPanel
//
this.filtersFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.filtersFlowLayoutPanel.Location = new System.Drawing.Point(3, 16);
this.filtersFlowLayoutPanel.Name = "filtersFlowLayoutPanel";
this.filtersFlowLayoutPanel.Size = new System.Drawing.Size(834, 261);
this.filtersFlowLayoutPanel.TabIndex = 0;
//
// resultsGroupBox
//
this.resultsGroupBox.Controls.Add(this.resultsListView);
this.resultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsGroupBox.Location = new System.Drawing.Point(0, 0);
this.resultsGroupBox.Name = "resultsGroupBox";
this.resultsGroupBox.Size = new System.Drawing.Size(840, 428);
this.resultsGroupBox.TabIndex = 1;
this.resultsGroupBox.TabStop = false;
this.resultsGroupBox.Text = "Query results";
//
// resultsListView
//
this.resultsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.resultsListView.Location = new System.Drawing.Point(3, 16);
this.resultsListView.Name = "resultsListView";
this.resultsListView.Size = new System.Drawing.Size(834, 409);
this.resultsListView.TabIndex = 0;
this.resultsListView.UseCompatibleStateImageBehavior = false;
this.resultsListView.View = System.Windows.Forms.View.Details;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.histogramBtn);
this.groupBox1.Controls.Add(this.statisticsBtn);
this.groupBox1.Location = new System.Drawing.Point(8, 608);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(125, 93);
this.groupBox1.TabIndex = 13;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Analysis";
//
// histogramBtn
//
this.histogramBtn.Location = new System.Drawing.Point(5, 55);
this.histogramBtn.Name = "histogramBtn";
this.histogramBtn.Size = new System.Drawing.Size(114, 32);
this.histogramBtn.TabIndex = 11;
this.histogramBtn.Text = "Histograms";
this.histogramBtn.UseVisualStyleBackColor = true;
this.histogramBtn.Click += new System.EventHandler(this.histogramBtn_Click);
//
// statisticsBtn
//
this.statisticsBtn.Location = new System.Drawing.Point(5, 18);
this.statisticsBtn.Name = "statisticsBtn";
this.statisticsBtn.Size = new System.Drawing.Size(114, 32);
this.statisticsBtn.TabIndex = 10;
this.statisticsBtn.Text = "Statistics";
this.statisticsBtn.UseVisualStyleBackColor = true;
this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click);
//
// outputGroupBox
//
this.outputGroupBox.Controls.Add(this.exportQueryResultsBtn);
this.outputGroupBox.Controls.Add(this.printQueryResultsBtn);
this.outputGroupBox.Location = new System.Drawing.Point(8, 509);
this.outputGroupBox.Name = "outputGroupBox";
this.outputGroupBox.Size = new System.Drawing.Size(125, 93);
this.outputGroupBox.TabIndex = 12;
this.outputGroupBox.TabStop = false;
this.outputGroupBox.Text = "Output";
//
// exportQueryResultsBtn
//
this.exportQueryResultsBtn.Location = new System.Drawing.Point(5, 18);
this.exportQueryResultsBtn.Name = "exportQueryResultsBtn";
this.exportQueryResultsBtn.Size = new System.Drawing.Size(114, 32);
this.exportQueryResultsBtn.TabIndex = 8;
this.exportQueryResultsBtn.Text = "Export query results";
this.exportQueryResultsBtn.UseVisualStyleBackColor = true;
this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click);
//
// printQueryResultsBtn
//
this.printQueryResultsBtn.Location = new System.Drawing.Point(5, 55);
this.printQueryResultsBtn.Name = "printQueryResultsBtn";
this.printQueryResultsBtn.Size = new System.Drawing.Size(113, 32);
this.printQueryResultsBtn.TabIndex = 9;
this.printQueryResultsBtn.Text = "Print query results";
this.printQueryResultsBtn.UseVisualStyleBackColor = true;
this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click);
//
// printerConfigBtn
//
this.printerConfigBtn.Location = new System.Drawing.Point(8, 316);
this.printerConfigBtn.Name = "printerConfigBtn";
this.printerConfigBtn.Size = new System.Drawing.Size(125, 35);
this.printerConfigBtn.TabIndex = 11;
this.printerConfigBtn.Text = "Configure printer";
this.printerConfigBtn.UseVisualStyleBackColor = true;
this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click);
//
// formatOfResultsBtn
//
this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276);
this.formatOfResultsBtn.Name = "formatOfResultsBtn";
this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 35);
this.formatOfResultsBtn.TabIndex = 7;
this.formatOfResultsBtn.Text = "Configure output";
this.formatOfResultsBtn.UseVisualStyleBackColor = true;
this.formatOfResultsBtn.Click += new System.EventHandler(this.formatOfResultsBtn_Click);
//
// clearFiltersBtn
//
this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196);
this.clearFiltersBtn.Name = "clearFiltersBtn";
this.clearFiltersBtn.Size = new System.Drawing.Size(125, 35);
this.clearFiltersBtn.TabIndex = 2;
this.clearFiltersBtn.Text = "Clear filters";
this.clearFiltersBtn.UseVisualStyleBackColor = true;
this.clearFiltersBtn.Click += new System.EventHandler(this.clearFiltersBtn_Click);
//
// settingsBtn
//
this.settingsBtn.Location = new System.Drawing.Point(8, 12);
this.settingsBtn.Name = "settingsBtn";
this.settingsBtn.Size = new System.Drawing.Size(125, 33);
this.settingsBtn.TabIndex = 0;
this.settingsBtn.Text = "Settings";
this.settingsBtn.UseVisualStyleBackColor = true;
this.settingsBtn.Click += new System.EventHandler(this.settingsBtn_Click);
//
// saveConfigBtn
//
this.saveConfigBtn.Location = new System.Drawing.Point(8, 356);
this.saveConfigBtn.Name = "saveConfigBtn";
this.saveConfigBtn.Size = new System.Drawing.Size(125, 35);
this.saveConfigBtn.TabIndex = 5;
this.saveConfigBtn.Text = "Save configuration";
this.saveConfigBtn.UseVisualStyleBackColor = true;
this.saveConfigBtn.Click += new System.EventHandler(this.saveConfigBtn_Click);
//
// loadConfigBtn
//
this.loadConfigBtn.Location = new System.Drawing.Point(8, 396);
this.loadConfigBtn.Name = "loadConfigBtn";
this.loadConfigBtn.Size = new System.Drawing.Size(125, 35);
this.loadConfigBtn.TabIndex = 4;
this.loadConfigBtn.Text = "Load configuration";
this.loadConfigBtn.UseVisualStyleBackColor = true;
this.loadConfigBtn.Click += new System.EventHandler(this.loadConfigBtn_Click);
//
// executeQueryBtn
//
this.executeQueryBtn.Location = new System.Drawing.Point(8, 468);
this.executeQueryBtn.Name = "executeQueryBtn";
this.executeQueryBtn.Size = new System.Drawing.Size(125, 35);
this.executeQueryBtn.TabIndex = 6;
this.executeQueryBtn.Text = "Execute query";
this.executeQueryBtn.UseVisualStyleBackColor = true;
this.executeQueryBtn.Click += new System.EventHandler(this.executeQueryBtn_Click);
//
// addFilterBtn
//
this.addFilterBtn.Location = new System.Drawing.Point(8, 236);
this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(125, 35);
this.addFilterBtn.TabIndex = 3;
this.addFilterBtn.Text = "Add filter";
this.addFilterBtn.UseVisualStyleBackColor = true;
this.addFilterBtn.Click += new System.EventHandler(this.addFilterBtn_Click);
//
// testBenchesGroupBox
//
this.testBenchesGroupBox.Controls.Add(this.checkBox6);
this.testBenchesGroupBox.Controls.Add(this.checkBox5);
this.testBenchesGroupBox.Controls.Add(this.checkBox4);
this.testBenchesGroupBox.Controls.Add(this.checkBox3);
this.testBenchesGroupBox.Controls.Add(this.checkBox2);
this.testBenchesGroupBox.Controls.Add(this.checkBox1);
this.testBenchesGroupBox.Location = new System.Drawing.Point(8, 54);
this.testBenchesGroupBox.Name = "testBenchesGroupBox";
this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 135);
this.testBenchesGroupBox.TabIndex = 1;
this.testBenchesGroupBox.TabStop = false;
this.testBenchesGroupBox.Text = "Test benches";
//
// checkBox6
//
this.checkBox6.AutoSize = true;
this.checkBox6.Location = new System.Drawing.Point(23, 110);
this.checkBox6.Name = "checkBox6";
this.checkBox6.Size = new System.Drawing.Size(85, 17);
this.checkBox6.TabIndex = 5;
this.checkBox6.TabStop = true;
this.checkBox6.Text = "radioButton6";
this.checkBox6.UseVisualStyleBackColor = true;
this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged);
//
// checkBox5
//
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(23, 92);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(85, 17);
this.checkBox5.TabIndex = 4;
this.checkBox5.TabStop = true;
this.checkBox5.Text = "radioButton5";
this.checkBox5.UseVisualStyleBackColor = true;
this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
//
// checkBox4
//
this.checkBox4.AutoSize = true;
this.checkBox4.Location = new System.Drawing.Point(23, 74);
this.checkBox4.Name = "checkBox4";
this.checkBox4.Size = new System.Drawing.Size(85, 17);
this.checkBox4.TabIndex = 3;
this.checkBox4.TabStop = true;
this.checkBox4.Text = "radioButton4";
this.checkBox4.UseVisualStyleBackColor = true;
this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
//
// checkBox3
//
this.checkBox3.AutoSize = true;
this.checkBox3.Location = new System.Drawing.Point(23, 55);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(85, 17);
this.checkBox3.TabIndex = 2;
this.checkBox3.TabStop = true;
this.checkBox3.Text = "radioButton3";
this.checkBox3.UseVisualStyleBackColor = true;
this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(23, 36);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(85, 17);
this.checkBox2.TabIndex = 1;
this.checkBox2.TabStop = true;
this.checkBox2.Text = "radioButton2";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(23, 17);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(85, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.TabStop = true;
this.checkBox1.Text = "radioButton1";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// ResultsBrowserWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 712);
this.Controls.Add(this.vSplitContainer);
this.Name = "ResultsBrowserWnd";
this.Text = "Results Browser";
this.Load += new System.EventHandler(this.ResultsBrowserWnd_Load);
this.vSplitContainer.Panel1.ResumeLayout(false);
this.vSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).EndInit();
this.vSplitContainer.ResumeLayout(false);
this.hSplitContainer.Panel1.ResumeLayout(false);
this.hSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).EndInit();
this.hSplitContainer.ResumeLayout(false);
this.filtersGroupBox.ResumeLayout(false);
this.resultsGroupBox.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.outputGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.ResumeLayout(false);
this.testBenchesGroupBox.PerformLayout();
this.ResumeLayout(false);
}
@@ -387,5 +439,9 @@
private System.Windows.Forms.RadioButton checkBox5;
private System.Windows.Forms.RadioButton checkBox4;
private System.Windows.Forms.Button printerConfigBtn;
private System.Windows.Forms.RadioButton checkBox6;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox outputGroupBox;
private System.Windows.Forms.Button histogramBtn;
}
}
+47 -20
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
@@ -62,6 +65,7 @@ namespace ResultsBrowser
checkBox3.Checked = Program.LocalSettings.Bench3Selected;
checkBox4.Checked = Program.LocalSettings.Bench4Selected;
checkBox5.Checked = Program.LocalSettings.Bench5Selected;
checkBox6.Checked = Program.LocalSettings.Bench6Selected;
if (args.Length == 1 && args[0].IndexOf(".qry") == args[0].Length - 4)
{
@@ -84,19 +88,24 @@ namespace ResultsBrowser
checkBox3.Text = Program.LocalSettings.Bench3;
checkBox4.Text = Program.LocalSettings.Bench4;
checkBox5.Text = Program.LocalSettings.Bench5;
checkBox6.Text = Program.LocalSettings.Bench6;
checkBox1.Visible = !string.IsNullOrEmpty(checkBox1.Text);
checkBox2.Visible = !string.IsNullOrEmpty(checkBox2.Text);
checkBox3.Visible = !string.IsNullOrEmpty(checkBox3.Text);
checkBox4.Visible = !string.IsNullOrEmpty(checkBox4.Text);
checkBox5.Visible = !string.IsNullOrEmpty(checkBox5.Text);
checkBox6.Visible = !string.IsNullOrEmpty(checkBox6.Text);
}
string BenchName()
{
return checkBox1.Checked ? Program.LocalSettings.Bench1
: checkBox2.Checked ? Program.LocalSettings.Bench2
: Program.LocalSettings.Bench3;
: checkBox2.Checked ? Program.LocalSettings.Bench2
: checkBox3.Checked ? Program.LocalSettings.Bench3
: checkBox4.Checked ? Program.LocalSettings.Bench4
: checkBox5.Checked ? Program.LocalSettings.Bench5
: Program.LocalSettings.Bench6;
}
void Localize()
@@ -133,6 +142,7 @@ namespace ResultsBrowser
private void checkBox3_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox4_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox5_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
private void checkBox6_CheckedChanged(object sender, EventArgs e) { SaveCheckBoxes(); }
void SaveCheckBoxes()
{
@@ -141,6 +151,7 @@ namespace ResultsBrowser
Program.LocalSettings.Bench3Selected = checkBox3.Checked;
Program.LocalSettings.Bench4Selected = checkBox4.Checked;
Program.LocalSettings.Bench5Selected = checkBox5.Checked;
Program.LocalSettings.Bench6Selected = checkBox6.Checked;
Program.LocalSettings.Save();
}
@@ -269,7 +280,8 @@ namespace ResultsBrowser
(checkBox3.Checked ? Program.LocalSettings.ConnectionString3 :
(checkBox4.Checked ? Program.LocalSettings.ConnectionString4 :
(checkBox5.Checked ? Program.LocalSettings.ConnectionString5 :
Program.LocalSettings.ConnectionString1))));
(checkBox6.Checked ? Program.LocalSettings.ConnectionString6 :
Program.LocalSettings.ConnectionString1)))));
ISession[] sessions = new ISession[] { Results.DB.CreateSession() };
@@ -398,21 +410,21 @@ namespace ResultsBrowser
{
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
}
#elif CEVAK_PT40_272
#elif CEVAK_40
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
foreach (var wm in waterMeters)
{
if (!batches.Contains(wm.Batch)) batches.Add(wm.Batch);
}
foreach (var batch in batches)
{
new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
Config.Entities.PageOrientation.Portrait,
60, 60, 60,
"PT40 Z/E-35-A",
"0111-OOP-C035-13").Print();
}
//foreach (var batch in batches)
//{
// new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
// Config.Entities.PageOrientation.Portrait,
// 60, 60, 60,
// "PT40 Z/E-35-A",
// "0111-OOP-C035-13").Print();
//}
#else
if (string.IsNullOrEmpty(filtersConfig.PrinterClass))
{
@@ -480,7 +492,7 @@ namespace ResultsBrowser
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
///
/// Enter options
/// Statistics options
///
Forms.StatisticsOptionsDlg optionsDlg = new Forms.StatisticsOptionsDlg(items);
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
@@ -488,16 +500,31 @@ namespace ResultsBrowser
///
/// Calculate statistics
///
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, optionsDlg.TwoDim,
optionsDlg.RowItem, optionsDlg.RowItem2, optionsDlg.RowItem3,
optionsDlg.ColumnItem, optionsDlg.ColumnItem2, optionsDlg.ColumnItem3,
optionsDlg.RowTestSpecifier, optionsDlg.RowTestSpecifier2, optionsDlg.RowTestSpecifier3,
optionsDlg.ColumnTestSpecifier, optionsDlg.ColumnTestSpecifier2, optionsDlg.ColumnTestSpecifier3,
timePeriodStart, timePeriodEnd);
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, optionsDlg, timePeriodStart, timePeriodEnd);
statisticsDlg.ShowDialog();
}
private void histogramBtn_Click(object sender, EventArgs e)
{
if (waterMeters == null || waterMeters.Count == 0) return;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
///
/// Histogram options
///
Forms.HistogramOptionsDlg optionsDlg = new Forms.HistogramOptionsDlg(items);
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
///
/// Calculate and display histograms
///
Forms.HistogramDlg histogramDlg = new Forms.HistogramDlg(waterMeters, optionsDlg, "Histogramy");
histogramDlg.ShowDialog();
}
/// <summary>
/// Updates component factory
/// </summary>
@@ -1,4 +1,4 @@
namespace MonitoringDB.Forms
namespace Statistics.Forms
{
partial class ModelessForm
{
@@ -2,7 +2,7 @@
using System.Drawing;
using System.Windows.Forms;
namespace MonitoringDB.Forms
namespace Statistics.Forms
{
public partial class ModelessForm : Form
{
+327
View File
@@ -0,0 +1,327 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
namespace Statistics
{
/// <summary>
/// Class to be serialized to an XML file...
/// Public members are local settings.
/// These settings are modified by dialogs invoked by menu items
/// Edit->Preferences ... PreferencesDlg ... S1.1(language, etc. local settings), and
/// Edit->Advanced settings ... AdvancedSettingsDlg ... S1.2(spec. where bench settings are stored)
/// </summary>
[XmlRootAttribute("Statistics")]
public class LocalSettings
{
public const int FlowsCount = 5;
/// <summary>
/// User interface language (used as CultureInfo(..) constructor argument).
/// </summary>
public string Language;
///
/// Names of test benches
///
public string[] BenchNames;
///
public string GetBenchName(int i)
{
return ((BenchNames != null) && (i >= 0) && (i < BenchNames.Length)) ? BenchNames[i] : string.Empty;
}
///
/// Database settings of servers
///
public string[] ConnectionStrings;
///
public string GetConnectionString(int i)
{
return ((ConnectionStrings != null) && (i >= 0) && (i < ConnectionStrings.Length)) ? ConnectionStrings[i] : string.Empty;
}
///
/// MID-s
///
public string[] MidNames;
///
/// Flow settings
///
public bool[] FlowEnabledI1;
public bool[] FlowEnabledI2;
public bool[] FlowEnabledI3;
public bool[] FlowEnabledI4;
public bool[] FlowEnabledI5;
public bool[] FlowEnabledI6;
public bool[] FlowEnabledI7;
/// <summary>
/// Get flow enabled info
/// </summary>
/// <param name="midId">1-based MID id</param>
/// <param name="i">0-based flow id</param>
/// <returns>true = enabled</returns>
public bool GetFlowEnabled(int midId, int i)
{
switch (midId)
{
case 1: return ((FlowEnabledI1 != null) && (i >= 0) && (i < FlowEnabledI1.Length)) ? FlowEnabledI1[i] : false;
case 2: return ((FlowEnabledI2 != null) && (i >= 0) && (i < FlowEnabledI2.Length)) ? FlowEnabledI2[i] : false;
case 3: return ((FlowEnabledI3 != null) && (i >= 0) && (i < FlowEnabledI3.Length)) ? FlowEnabledI3[i] : false;
case 4: return ((FlowEnabledI4 != null) && (i >= 0) && (i < FlowEnabledI4.Length)) ? FlowEnabledI4[i] : false;
case 5: return ((FlowEnabledI5 != null) && (i >= 0) && (i < FlowEnabledI5.Length)) ? FlowEnabledI5[i] : false;
case 6: return ((FlowEnabledI6 != null) && (i >= 0) && (i < FlowEnabledI6.Length)) ? FlowEnabledI6[i] : false;
case 7: return ((FlowEnabledI7 != null) && (i >= 0) && (i < FlowEnabledI7.Length)) ? FlowEnabledI7[i] : false;
default:
return false;
}
}
/// <summary>
/// Set flow enabled info
/// </summary>
/// <param name="midId">1-based MID id</param>
/// <param name="i">0-based flow id</param>
/// <param name="value">true = enabled</param>
public void SetFlowEnabled(int midId, int i, bool value)
{
switch (midId)
{
case 1: if ((FlowEnabledI1 != null) && (i >= 0) && (i < FlowEnabledI1.Length)) { FlowEnabledI1[i] = value; }; break;
case 2: if ((FlowEnabledI2 != null) && (i >= 0) && (i < FlowEnabledI2.Length)) { FlowEnabledI2[i] = value; }; break;
case 3: if ((FlowEnabledI3 != null) && (i >= 0) && (i < FlowEnabledI3.Length)) { FlowEnabledI3[i] = value; }; break;
case 4: if ((FlowEnabledI4 != null) && (i >= 0) && (i < FlowEnabledI4.Length)) { FlowEnabledI4[i] = value; }; break;
case 5: if ((FlowEnabledI5 != null) && (i >= 0) && (i < FlowEnabledI5.Length)) { FlowEnabledI5[i] = value; }; break;
case 6: if ((FlowEnabledI6 != null) && (i >= 0) && (i < FlowEnabledI6.Length)) { FlowEnabledI6[i] = value; }; break;
case 7: if ((FlowEnabledI7 != null) && (i >= 0) && (i < FlowEnabledI7.Length)) { FlowEnabledI7[i] = value; }; break;
default:
break;
}
}
public double[] FlowFromI1;
public double[] FlowFromI2;
public double[] FlowFromI3;
public double[] FlowFromI4;
public double[] FlowFromI5;
public double[] FlowFromI6;
public double[] FlowFromI7;
/// <summary>
/// Get lower limit of the flow
/// </summary>
/// <param name="midId">1-based MID id</param>
/// <param name="i">0-based flow id</param>
/// <returns>Flow in m3/h</returns>
public double GetFlowFrom(int midId, int i)
{
switch (midId)
{
case 1: return ((FlowFromI1 != null) && (i >= 0) && (i < FlowFromI1.Length)) ? FlowFromI1[i] : 0;
case 2: return ((FlowFromI2 != null) && (i >= 0) && (i < FlowFromI2.Length)) ? FlowFromI2[i] : 0;
case 3: return ((FlowFromI3 != null) && (i >= 0) && (i < FlowFromI3.Length)) ? FlowFromI3[i] : 0;
case 4: return ((FlowFromI4 != null) && (i >= 0) && (i < FlowFromI4.Length)) ? FlowFromI4[i] : 0;
case 5: return ((FlowFromI5 != null) && (i >= 0) && (i < FlowFromI5.Length)) ? FlowFromI5[i] : 0;
case 6: return ((FlowFromI6 != null) && (i >= 0) && (i < FlowFromI6.Length)) ? FlowFromI6[i] : 0;
case 7: return ((FlowFromI7 != null) && (i >= 0) && (i < FlowFromI7.Length)) ? FlowFromI7[i] : 0;
default:
return 0;
}
}
/// <summary>
/// Set lower limit of the flow
/// </summary>
/// <param name="midId">1-based MID id</param>
/// <param name="i">0-based flow id</param>
/// <param name="value">Flow in m3/h</param>
public void SetFlowFrom(int midId, int i, double value)
{
switch (midId)
{
case 1: if ((FlowFromI1 != null) && (i >= 0) && (i < FlowFromI1.Length)) { FlowFromI1[i] = value; }; break;
case 2: if ((FlowFromI2 != null) && (i >= 0) && (i < FlowFromI2.Length)) { FlowFromI2[i] = value; }; break;
case 3: if ((FlowFromI3 != null) && (i >= 0) && (i < FlowFromI3.Length)) { FlowFromI3[i] = value; }; break;
case 4: if ((FlowFromI4 != null) && (i >= 0) && (i < FlowFromI4.Length)) { FlowFromI4[i] = value; }; break;
case 5: if ((FlowFromI5 != null) && (i >= 0) && (i < FlowFromI5.Length)) { FlowFromI5[i] = value; }; break;
case 6: if ((FlowFromI6 != null) && (i >= 0) && (i < FlowFromI6.Length)) { FlowFromI6[i] = value; }; break;
case 7: if ((FlowFromI7 != null) && (i >= 0) && (i < FlowFromI7.Length)) { FlowFromI7[i] = value; }; break;
default:
break;
}
}
public double[] FlowToI1;
public double[] FlowToI2;
public double[] FlowToI3;
public double[] FlowToI4;
public double[] FlowToI5;
public double[] FlowToI6;
public double[] FlowToI7;
/// <summary>
/// Get upper limit of the flow
/// </summary>
/// <param name="midId">1-based MID id</param>
/// <param name="i">0-based flow id</param>
/// <returns>Flow in m3/h</returns>
public double GetFlowTo(int midId, int i)
{
switch (midId)
{
case 1: return ((FlowToI1 != null) && (i >= 0) && (i < FlowToI1.Length)) ? FlowToI1[i] : 0;
case 2: return ((FlowToI2 != null) && (i >= 0) && (i < FlowToI2.Length)) ? FlowToI2[i] : 0;
case 3: return ((FlowToI3 != null) && (i >= 0) && (i < FlowToI3.Length)) ? FlowToI3[i] : 0;
case 4: return ((FlowToI4 != null) && (i >= 0) && (i < FlowToI4.Length)) ? FlowToI4[i] : 0;
case 5: return ((FlowToI5 != null) && (i >= 0) && (i < FlowToI5.Length)) ? FlowToI5[i] : 0;
case 6: return ((FlowToI6 != null) && (i >= 0) && (i < FlowToI6.Length)) ? FlowToI6[i] : 0;
case 7: return ((FlowToI7 != null) && (i >= 0) && (i < FlowToI7.Length)) ? FlowToI7[i] : 0;
default:
return 0;
}
}
/// <summary>
/// Set upper limit of the flow
/// </summary>
/// <param name="midId">1-based MID id</param>
/// <param name="i">0-based flow id</param>
/// <param name="value">Flow in m3/h</param>
public void SetFlowTo(int midId, int i, double value)
{
switch (midId)
{
case 1: if ((FlowToI1 != null) && (i >= 0) && (i < FlowToI1.Length)) { FlowToI1[i] = value; }; break;
case 2: if ((FlowToI2 != null) && (i >= 0) && (i < FlowToI2.Length)) { FlowToI2[i] = value; }; break;
case 3: if ((FlowToI3 != null) && (i >= 0) && (i < FlowToI3.Length)) { FlowToI3[i] = value; }; break;
case 4: if ((FlowToI4 != null) && (i >= 0) && (i < FlowToI4.Length)) { FlowToI4[i] = value; }; break;
case 5: if ((FlowToI5 != null) && (i >= 0) && (i < FlowToI5.Length)) { FlowToI5[i] = value; }; break;
case 6: if ((FlowToI6 != null) && (i >= 0) && (i < FlowToI6.Length)) { FlowToI6[i] = value; }; break;
case 7: if ((FlowToI7 != null) && (i >= 0) && (i < FlowToI7.Length)) { FlowToI7[i] = value; }; break;
default:
break;
}
}
/// StatisticsDlg UI
public int SelectedRadioButtonNumber;
/// MainWnd
public int MainWndLeft;
public int MainWndTop;
public int MainWndWidth;
public int MainWndHeight;
public bool ManiWndMaximized;
public int SplitterDistance;
/// <summary>
/// Default constructor which is used to create default settings
/// </summary>
public LocalSettings()
{
#if GENESIS
Language = "DE";
BenchNames = new string[] { "Genesis" };
ConnectionStrings = new string[]
{
"SERVER=localhost; DATABASE=genesis-r; UID=root; PASSWORD=; CHARSET=utf8;",
};
MidNames = new string[] { string.Empty, "I11", "I12", "I2", "I3", "I4", "I5" }; /// Index is MID-id
#else
Language = "SK";
BenchNames = new string[] { "WR10", "WR11", "WR13", "WR14", "WR15", "PT7" };
ConnectionStrings = new string[]
{
"SERVER=10.42.128.93; DATABASE=st-wr10-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
"SERVER=10.42.128.102; DATABASE=st-wr11-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
"SERVER=10.42.128.89; DATABASE=st-wr13-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
"SERVER=10.42.128.213; DATABASE=st-wr14-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
"SERVER=10.42.128.214; DATABASE=st-wr15-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
"SERVER=10.42.129.26; DATABASE=iperlspecial-r; UID=vysledky; PASSWORD=GAqx76QUB6NbnpZP; CHARSET=utf8;",
};
MidNames = new string[] { string.Empty, "I1", "I2", "I3", "I4" }; /// Index is MID-id
#endif
FlowEnabledI1 = new bool[FlowsCount];
FlowEnabledI2 = new bool[FlowsCount];
FlowEnabledI3 = new bool[FlowsCount];
FlowEnabledI4 = new bool[FlowsCount];
FlowEnabledI5 = new bool[FlowsCount];
FlowEnabledI6 = new bool[FlowsCount];
FlowEnabledI7 = new bool[FlowsCount];
FlowFromI1 = new double[FlowsCount];
FlowFromI2 = new double[FlowsCount];
FlowFromI3 = new double[FlowsCount];
FlowFromI4 = new double[FlowsCount];
FlowFromI5 = new double[FlowsCount];
FlowFromI6 = new double[FlowsCount];
FlowFromI7 = new double[FlowsCount];
FlowToI1 = new double[FlowsCount];
FlowToI2 = new double[FlowsCount];
FlowToI3 = new double[FlowsCount];
FlowToI4 = new double[FlowsCount];
FlowToI5 = new double[FlowsCount];
FlowToI6 = new double[FlowsCount];
FlowToI7 = new double[FlowsCount];
SelectedRadioButtonNumber = 1;
}
/// <summary>
/// Load local settings (public fields of this class) from the XML file.
/// </summary>
public static LocalSettings Load(string fileName)
{
try
{
using (TextReader reader = new StreamReader(fileName))
{
LocalSettings ls = (new XmlSerializer(typeof(LocalSettings))).Deserialize(reader) as LocalSettings;
// Copy the settings just in case De-serialize() completes OK
return ls;
}
}
catch (Exception e)
{
string msg = e.Message;
return null;
}
}
/// <summary>
/// Save local settings (public fields of this class) to the XML file.
/// </summary>
public void Save()
{
try
{
using (TextWriter writer = new StreamWriter(Program.LocalSettingsFileName))
{
(new XmlSerializer(typeof(LocalSettings))).Serialize(writer, this);
}
}
catch (Exception e)
{
string msg = e.Message;
}
}
}
}

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