Compare commits

..
Author SHA1 Message Date
Milan Hanajik 2958d83527 Reconfigured for Munich 2017-03-08 10:35:31 +01:00
Milan Hanajik 3c51b92e5e Serious bug in saving/printing results for compound meters fixed, ver. 2.12.486 2017-03-08 10:35:08 +01:00
Milan Hanajik 697b0b3538 Munich : ResultsBrowser prints the bench name, ver. 2.12.485 2017-03-08 07:26:03 +01:00
Milan Hanajik 08b47776ec German only text when a camera was not detected on startup. 2017-03-08 06:52:18 +01:00
Milan Hanajik 0370d1f582 TestStartEndForm (and IHasWMStatesForm interface) added to DataEntry.Munich3 2017-03-07 19:01:49 +01:00
Milan Hanajik fa5b427d4d Simulated mode for FixedStartMassCollection method, Bug fix in DataEntry.Standard6.TestStartEndForm, ver. 2.12.485 2017-03-07 19:00:36 +01:00
Milan Hanajik 21102bb991 Compound meter result items added, ver. 2.12.484 2017-03-07 11:53:29 +01:00
Milan Hanajik b00b6e8412 Munich : Printer clean-up and fixes, ver. 2.12.483 2017-03-07 09:45:00 +01:00
Milan Hanajik 5b4a9c0129 Network.Camera.CLP1611 : IP address can be specified. 2017-03-06 13:21:10 +01:00
Milan Hanajik dc2b945230 Some progress on Easytherm communication. 2017-03-06 00:33:44 +01:00
Milan Hanajik 9ff58c9e0b ver. 2.12.482 2017-03-02 14:12:14 +01:00
Milan Hanajik df0a38e3c6 MettlerToledo.TankDraining, ITankDrainingCfg, ITankDraining class/interfaces added, EmptyValve --> DrainValve 2017-03-02 09:17:22 +01:00
Milan Hanajik 33b349e333 ComponentsManagerDlg : Up and down button implemented. 2017-02-28 22:39:56 +01:00
Milan Hanajik ab14866575 'AskYesNoForm' and 'MessageBoxForm' widths are calculated from the text width. 2017-02-28 13:50:17 +01:00
Milan Hanajik 0f6a3ffa80 Width of the form with "Test bench framework program is closing" is calculated from the text width. 2017-02-28 13:49:18 +01:00
Milan Hanajik fde4b8b16f Resources cleanup 2017-02-28 12:35:41 +01:00
Milan Hanajik c450eaf339 Logging into TBF program in case central users server is not running (and login fails) is fixed, ver. 2.12.481 2017-02-28 11:09:09 +01:00
Milan Hanajik 30819bbacd Output.FileWriters.Enhanced : Bug fix for Badger Meter, ver. 2.12.479 2017-02-22 20:39:22 +01:00
Milan Hanajik fce6e65218 ResultsBrowser released, ver. 2.12.478 2017-02-22 20:24:01 +01:00
Milan Hanajik 9550f97f8e Badger specific modification of Output.FileWriters.Enhanced, ver. 2.12.478 2017-02-22 19:25:41 +01:00
Milan Hanajik bb9c2b13e5 Badger : More logging in RegisterReader,ver. 2.12.477 2017-02-22 18:26:16 +01:00
Milan Hanajik aafcf77004 Output.FileWriters.Enhanced and Output.FileWriters.Xml fixed, ver. 2.12.476 2017-02-22 16:32:19 +01:00
Milan Hanajik 89c9e69a03 ToolTips temporarily disabled. 2017-02-22 14:49:23 +01:00
Milan Hanajik 6a072b7814 ResultsConfigDlg modifications : TabControl with three TreeViews, ver. 2.12.475 2017-02-22 14:07:20 +01:00
Milan Hanajik 4515f0fc13 FlyingStartMassCollectionSeq modified : Valves/pumps are closed immediately after the test only when there are no subsequent test repeats. 2017-02-21 10:45:26 +01:00
Milan Hanajik e7723c108d Bug fix : iPerl RFID comm. evaluation in case RegisterReaders are not complete fixed, ver. 2.12.475 2017-02-21 10:33:08 +01:00
Milan Hanajik 970fc886c6 FlyingStartMassCollectionSeq : If transitionAfter is not used, the valves/pumps are closed immediately after the test before the 2nd mass measurement, ver. 2.12.472 2017-02-17 10:51:30 +01:00
Milan Hanajik 7b093a5623 MettlerToledo..BalanceNewDev : Scale 'overload' does not update 'mass' and static 'Masses[balanceNr]' variables, ver. 2.12 471 2017-02-17 10:11:34 +01:00
Milan Hanajik 9a2e7ea72b Network.Camera.CLP1611.GrabImageOp added. 2017-02-17 08:50:19 +01:00
Milan Hanajik 8b188c9c75 LiveStreamOp : VLC start modified. 2017-02-16 21:38:01 +01:00
Milan Hanajik 4aed5c15a0 Network.Camera.CLP1611.LiveStreamOp added, ver. 2.12.470 2017-02-16 18:45:30 +01:00
Milan Hanajik 305d99d654 WinSCP image transfer integrated into Network.CLP1611.Camera and Roi detection. 2017-02-16 14:57:37 +01:00
Milan Hanajik 1029308b2c Network.Telnet and Network.CLP1611.Camera : Skip the first line in the VT terminal when logging on, ver. 2.12.468 2017-02-16 11:42:15 +01:00
Milan Hanajik 463e3fd0aa MettlerToledo.all and Ambient.Comet : Fixed bugs in serial port handling when closing the program, ver. 2.12.467 2017-02-16 09:55:49 +01:00
Milan Hanajik 3ee6e16592 Output.FileWriters.Xml component for BWB added. 2017-02-16 09:15:44 +01:00
Milan Hanajik 2b7ad1ef7d Output.FileWriters.Enhanced : (1) Old style ResultsConfigDlg removed, (2) Configuration change handling, ver. 2 12.466 2017-02-16 09:15:35 +01:00
Milan Hanajik 4c66ba4038 German 2017-02-16 09:15:24 +01:00
Milan Hanajik eb1ff6ddda ver. 2.12.465 2017-02-15 12:36:11 +01:00
Milan Hanajik ff837fc076 ver. 2.12.464 2017-02-15 12:14:33 +01:00
Milan Hanajik 5cbddcaaf4 Results.WMeterRsltItemSpec bug fix : Serialization in ToStrArray() and FromStrArray() was not language independent. 2017-02-15 11:48:47 +01:00
Milan Hanajik 24884de4e4 German translations I. 2017-02-15 10:58:43 +01:00
Milan Hanajik efc4668200 Only relevant units are displayed by ComboBox when using ResultsConfigDlg 2017-02-15 10:57:37 +01:00
Milan Hanajik a90ba0c546 Camera.CLP1611: (1) 'AutoDetect' feature works OK, (2) UI: TestImagesCount value not checked when UseTestImages=false, ver. 2.12.463 2017-02-14 16:49:59 +01:00
Milan Hanajik d039df5361 (1) iPerl RFID comm. evaluation in case RegisterReaders are not complete fixed
(2) Procedure copy UI bug fixed
(3) Genesis : A bug when using TankSelector via Modbus and closing the program fixed.
2017-02-14 15:52:44 +01:00
Milan Hanajik 8d4910fcb0 Symbols: introduced IPERL, ORACLE_DB, HEAT_METERS, TURA_IPERL, TURA_SPECIAL
abandoned IPERLST, IPERLSTSPECIAL, HEAT_METERS_SUPPORT
2017-02-14 13:42:22 +01:00
Milan Hanajik f30d785fb3 TankSelector.SelectTankOp added, TransitionStep: StepCondition EndCondition --> string EndCondition, etc. 2017-02-11 22:32:43 +01:00
Milan Hanajik efdd138379 DigitalInputs uint --> ulong 2017-02-11 10:12:10 +01:00
Milan Hanajik 115f83aeb0 ISequenceCondition interface added 2017-02-11 09:11:11 +01:00
Milan Hanajik b93eaadfc2 Compound meters : Process screens '24' and '48' modified as well, ver. 2.12.460 2017-02-10 18:29:07 +01:00
Milan Hanajik 1233f17dc4 Genesis : Process screen '6' for compound meters fixed, ver. 2.12.459 2017-02-10 18:12:22 +01:00
Milan Hanajik 2a2dbcca83 Genesis : Component upgraded, more logging in registerReader, ver. 2.12.458 2017-02-10 17:47:39 +01:00
Milan Hanajik e9070e5cc3 Modbus.Easytherm component added, QuidoRS.TankSelector --> TankSelector, ver. 2.12.457 2017-02-10 14:29:15 +01:00
Milan Hanajik 7319a9aee4 MassStart, MassEnd added to (old) results items, ver. 2.12.456 2017-02-10 10:20:07 +01:00
Milan Hanajik 93513100eb QuidoRS : Watchdog is optional, configurable, ver. 2 12.455 2017-02-09 20:59:00 +01:00
Milan Hanajik 46cc618300 TankSelector component added 2017-02-09 20:58:04 +01:00
Milan Hanajik 7ac1f2d431 Genesis specific changes, error messages fixed, smalled branch scale fixed, ver.2.12.455 2017-02-09 12:34:36 +01:00
Milan Hanajik d96f124bb3 IPAddress and TcpipPortNr added to WaterMeters.iPerl configuration and UI. 2017-02-06 18:34:32 +01:00
Milan Hanajik 3fd56531da (1) Genesis component upgraded, (2) FixedStartMassCollectionSeq : Opening start/stop valve in 2nd repetition fixed, ver. 2.12.453 2017-02-06 17:44:13 +01:00
Milan Hanajik 83fa635ee9 Polish resources dated 31.01.2017 imported into solution. 2017-02-06 17:25:17 +01:00
Milan Hanajik be8dededff Component for Warsaw upgraded, ver. 2.12.452 2017-01-31 00:44:08 +01:00
Milan Hanajik f318cfe6f0 Network.Camera bug fixes, Operations.ReturnGivenEventOp added, usefull for debuging, ver.2.12.451 2017-01-27 16:37:09 +01:00
Milan Hanajik 3f311d8603 Camera ROI modified for the use of 'periods', ver. 2.12.450 2017-01-27 14:34:17 +01:00
Milan Hanajik 3b13756db9 Measured data extracted from Telnet data, ver.2.12.449 2017-01-27 12:47:32 +01:00
Milan Hanajik 20b3840445 Komponent pre Berlin upgraded. 2017-01-27 09:57:54 +01:00
Milan Hanajik 2a4d95bd7b MersurementOp presunuta do Camera komponentu. 2017-01-27 09:56:58 +01:00
Milan Hanajik e8966f6705 Camera : Logging of incoming measurement datagrams, ver. 2.12.448 2017-01-26 16:18:09 +01:00
Milan Hanajik a20edf7890 Processing 'measurement' datagrams implemented. 2017-01-26 15:45:42 +01:00
Milan Hanajik f1d73421c8 Changes to make it possible to test with dummy components. 2017-01-25 17:59:26 +01:00
Milan Hanajik 97611369c4 Dummy.RegulValve and Dummy.FlowMeter components added. 2017-01-25 17:29:12 +01:00
Milan Hanajik 5ca265fef7 Berlin component upgraded 2017-01-25 17:29:11 +01:00
Milan Hanajik 38c199f6f9 Interfaces between Camera and Roi and sequences finalized, TODO: network communication, ver. 2.12.446
Sequences more robust for debugging, T and Pr-meters checked for null
2017-01-25 17:28:57 +01:00
Milan Hanajik 02ce6bf7c0 Russian resources added, ver. 2.12.443 2017-01-24 16:14:12 +01:00
Milan Hanajik fc3cef37d2 Bug fix : Berlin global defines 2017-01-24 15:47:38 +01:00
Milan Hanajik d9021ea140 Component version logged. 2017-01-24 15:19:11 +01:00
Milan Hanajik ebf03af9c1 Global defines clean-up 2017-01-24 15:06:45 +01:00
Milan Hanajik 044e53f2b2 Changes under construction : ROI registration to Cameras, ver. 2.12.441 2017-01-24 12:34:52 +01:00
Milan Hanajik 01ebd94073 Import of temperature coefficients fixed, ver. 2.12.440 2017-01-23 16:15:18 +01:00
Milan Hanajik e9c7430a48 BenchId conversion for WR9...WR16 in Results.Utils. 2017-01-23 15:38:15 +01:00
Milan Hanajik 2150ced11f Propagation of ROI parameters between ROI-s and Cameras implemented, ver. 2.12.438 2017-01-22 20:40:12 +01:00
Milan Hanajik ada96d3d83 Camera.CLP1611 and Camera.Roi : UseTestImages and TestImagesCount parameters added. 2017-01-22 19:38:16 +01:00
Milan Hanajik 5b4a797719 Bug fix in DeviceTest. 2017-01-22 19:37:02 +01:00
Milan Hanajik 18cf0b5de3 ROI help text modified/corrected. 2017-01-18 16:59:17 +01:00
Milan Hanajik cf876aabd2 Changes done in Munich : Roi CfgChangeHandler, new component, new Headpic, etc. 2017-01-17 16:49:47 +01:00
Milan Hanajik 2ced1417ed Hot bug fixes, ver. 2.12.436 2017-01-16 21:42:59 +01:00
Milan Hanajik 6d45b2c878 RoiDetectionSeq modified, ready to be tested. 2017-01-16 15:51:34 +01:00
Milan Hanajik f5d1014b89 MeasurementOp moved to camera 2017-01-16 14:21:18 +01:00
Milan Hanajik 13d00ee18e Telnet terminal window closing issue fixed, ver.2.12.435 2017-01-16 13:49:30 +01:00
Milan Hanajik c73cf7002f Camera.Roi.MeasurementOp added, UDP listener added, PulsesPerLtr (and ProcedureParams) added, etc. 2017-01-16 13:49:29 +01:00
Milan Hanajik 739759ddc3 Component/Device name displayed in case of an exception during components loading or devices initialization. 2017-01-16 13:49:28 +01:00
Milan Hanajik e34fc6a1f2 Cleanup : IdcCamera and RoI archaic code removed. 2017-01-14 21:09:57 +01:00
Milan Hanajik 6e9bfb61cc DeviceTest extended to 4 components (= parent + 3 components) 2017-01-14 21:09:56 +01:00
Milan Hanajik 5634931cc2 PreviousRoi parameter added to RoiCfg, masks prepared at the very last moment in RoiDetectionOp, Event.RoiDetectionPreviousFailed added. 2017-01-14 21:08:42 +01:00
Milan Hanajik a7c8b90e9f RoI --> Roi 2017-01-14 14:23:32 +01:00
Milan Hanajik 8e058cebbb RoI detection fixed : parses the command line response, returns Event.RoiDetectionPassed or Event.RoiDetectionFailed. 2017-01-13 19:12:28 +01:00
Milan Hanajik 08acc5778a RoI : RoiDetectionOp in progress 2017-01-13 18:36:12 +01:00
Milan Hanajik 2199679d28 DeviceTest extended to 3 components. 2017-01-13 18:35:08 +01:00
Milan Hanajik e730ee1541 Camera.HRLiveStreamOp operation added, RoiDetectionOp moved to RoI component, etc. 2017-01-13 15:27:17 +01:00
Milan Hanajik 7c1d0be9c9 Language resources exported 2017-01-11 12:45:38 +01:00
Milan Hanajik 5ba9352576 pw, ver. 2.12.434 2017-01-11 12:44:57 +01:00
Milan Hanajik 21ee6b7a65 Stop devices that were already started in case of an exception when starting devices --> avoid problems when closing the program. 2017-01-06 13:58:32 +01:00
Milan Hanajik dd85f03328 RoiDetectionOp added, etc. 2017-01-06 00:49:38 +01:00
Milan Hanajik 254afc3978 Network.Adapter, Network.Camera.CLP1611, Network.Camera.RoI Network.Tftp and Network.Telnet components added. Camera detection and live strean work OK. 2017-01-05 19:59:26 +01:00
Milan Hanajik ad51719d92 DeviceTest : logging added, bug fix in saving settings 2017-01-05 19:58:30 +01:00
Milan Hanajik e43e0a6850 Minor fixes, ver. 2.12.433 2016-12-29 12:29:37 +01:00
Milan Hanajik 535af59860 Number of 'Empty tank' buttons in BenchControlPanel 2 or 3 (automatically switched), ver. 2.12.432 2016-12-22 15:38:56 +01:00
Milan Hanajik 3f08036139 ver. 2.12.431 2016-12-22 12:02:11 +01:00
Milan Hanajik 7f31a84000 iPerlST (Special) : idBenutzer = 6 always when writing into Oracle DB, ver. 2.12.430 2016-12-22 08:24:31 +01:00
Milan Hanajik c672a49146 Genesis (UInt128) bug fix, ver. 2.12.429 2016-12-21 17:51:27 +01:00
Milan Hanajik e84f87fcda Bug fix in TBF.Forms.DatabaseSettingsDlg 2016-12-21 15:19:00 +01:00
Milan Hanajik 070f435a23 Login method selection is saved in local settings. 2016-12-21 14:54:38 +01:00
Milan Hanajik 2fcdfabd3c System login : Changes allowing usage of (1) short name, (2) full name, (3) user number. 2016-12-21 14:23:39 +01:00
Milan Hanajik 12053b4531 Login dialogs moved to TBF.Forms namesspace. 2016-12-21 08:06:42 +01:00
Milan Hanajik 1a0b2ee975 Generic bug fix : Procedure crashes when there is no test at all. 2016-12-21 07:56:37 +01:00
Milan Hanajik 13b80de703 Config.IUser interface added, etc. 2016-12-21 07:56:26 +01:00
Milan Hanajik 9bd409e672 Config.Entities.User.CurrentUser --> Config.Data.CurrentUser
Config.Entities.User.LastAuthorization --> Config.Data.lastAuthorization
2016-12-20 14:22:56 +01:00
Milan Hanajik 435e47707d ver. 2.12.426 2016-12-20 13:16:58 +01:00
Milan Hanajik 4da0717729 (1) Transition sequences can be debugged using NEXT, (2) Route using Uint128 fixed. 2016-12-20 13:13:17 +01:00
Milan Hanajik 98fe6223b4 One more change related to Users DB. 2016-12-20 10:16:08 +01:00
Milan Hanajik b4e84c36b8 Users DB added into DatabaseSettings and the related form. 2016-12-19 14:39:28 +01:00
Milan Hanajik bf92f677fe Separate Users DB added. 2016-12-19 13:58:57 +01:00
Milan Hanajik 62f26719ba iPerl bug fixes. 2016-12-19 13:52:00 +01:00
Milan Hanajik beff091699 Databases : Minor improvements, ver. 2.12.424 2016-12-19 13:01:25 +01:00
Milan Hanajik 72debd397f ver. 2.12.423 2016-12-19 10:59:48 +01:00
Milan Hanajik 89901c75f7 Revert "Elde.FlowMeterTwins bug-fix in calculation of ref. pulses and flow."
This reverts commit be52e2df96.
2016-12-16 13:07:54 +01:00
Milan Hanajik 8a73968f41 SLM-END : Component upgraded, ver. 2.12.421 2016-12-16 13:04:19 +01:00
Milan Hanajik eb2c3d00ce Berlin component added, defines for Berlin added, ver. 2.12.420 2016-12-14 11:09:23 +01:00
Milan Hanajik dd62310e59 ulong --> UInt128 in all 'route' related variables, ver. 2.12.419 2016-12-12 17:39:12 +01:00
Milan Hanajik a782d3960a .gitignore and clean.bat updated after Dirichlet.Numerics addition. 2016-12-12 16:43:05 +01:00
Milan Hanajik d5f91e9bab 'Route' type changes from uint to Dirichlet.Numerics.UInt128 2016-12-12 16:43:05 +01:00
Milan Hanajik be52e2df96 Elde.FlowMeterTwins bug-fix in calculation of ref. pulses and flow. 2016-12-12 16:43:04 +01:00
Milan Hanajik 72418d802c UInt128 type added - Dirichlet.Numerics project/namespace 2016-12-12 16:42:55 +01:00
Milan Hanajik 534361b540 Puchong-PT200 component updated (dated 07.11.2016) 2016-12-12 12:09:03 +01:00
Milan Hanajik 77782a8729 sensus a xylem brand logo in AboutDlg, ver. 2.12.417 2016-12-12 10:29:02 +01:00
Milan Hanajik 7dc42fb900 EnduranceDataLogging - initial version, ver. 2.12.416 2016-12-12 00:01:25 +01:00
Milan Hanajik da4b5a50a7 Import of temperature coefficients, ver. 2.12.415 2016-12-10 17:33:14 +01:00
Milan Hanajik c8c411aebc TestMethods.OuterLoop.Start/End UI changes, ver. 2.12.414 2016-12-10 16:27:51 +01:00
Milan Hanajik 8b4890560e Warsaw-END component updated, FW upgrade is required !!!, ver. 2.12.413 2016-12-10 15:12:47 +01:00
Milan Hanajik 216e08d57c Execute(...) arguments changed everywhere, repetitionNr usage depends on outerLoopMode, outerLoopCounter, ver. 2.12.412 2016-12-10 13:03:35 +01:00
Milan Hanajik f9888a2108 TestMethods.OuterLoop.Start and TestMethods.OuterLoop.End added. 2016-12-10 12:13:45 +01:00
Milan Hanajik f3b178473c Outer loop logic added, TODO: (1) Begin-block and End-block test methods, (2) support in test method sequences 2016-12-10 11:33:31 +01:00
Milan Hanajik 20c7b07cb9 Endurance : Switching test : Progress bar update and statistics added. 2016-12-10 11:33:30 +01:00
Milan Hanajik 5e4da449ad Endurance TestParams disabled. 2016-12-10 11:33:30 +01:00
Milan Hanajik c8d0c647b7 Endurance : uint[3] cBrd.WMeterCont added, ver. 2.12.411 2016-12-10 11:33:18 +01:00
Milan Hanajik e1eedb039c Warsaw-END, SLM-END : Number of water meters changed to 10, ver. 2.12.410 2016-12-09 19:44:20 +01:00
Milan Hanajik c30043d4fc Warsaw-END, Endurance : Component updated, CycleStepsCtrl UI fixed, ver. 2.12.408 2016-12-09 18:06:14 +01:00
Milan Hanajik 58a3340f53 Endurance : cBrd.CyclePar usage change, ver. 2.12.407 2016-12-09 16:37:25 +01:00
Milan Hanajik 1143fa79ae Dummy.Diverter component added 2016-12-09 12:20:35 +01:00
Milan Hanajik 56217a68ce Dummy.Valve component added 2016-12-09 12:20:23 +01:00
Milan Hanajik 6df36659ab Dummy.Balance component added 2016-12-09 12:13:59 +01:00
Milan Hanajik 6f599d55c5 Endurance : Bux fixes 2016-12-09 10:57:27 +01:00
Milan Hanajik b91888213b ExecuteCommandOp added (Endurance). 2016-12-08 14:36:51 +01:00
Milan Hanajik 10221d636c Endurance cycle UI: duration in 10ms steps, message disabled, Uint32 used, other minor changes. 2016-12-08 10:58:09 +01:00
Milan Hanajik 5c9adba751 Endurance cycle steps dialog added. 2016-12-07 20:57:32 +01:00
Milan Hanajik d2af4f224e ver. 2.12.404 2016-12-07 15:44:50 +01:00
Milan Hanajik 3a029432f8 Start- and End-volume for the fixed start method can be saved/printed in results. 2016-12-07 15:44:26 +01:00
Milan Hanajik 72a5385c57 TempMeter has 'Default temperature' parameter which specifies a value for simulated mode. 2016-12-05 23:22:33 +01:00
Milan Hanajik 1028866721 Initial version of a component for Genesis (the previous one was the one for Puchong). 2016-12-05 13:27:09 +01:00
Milan Hanajik 9bd37c2980 Components management : fix of UI behavior. 2016-12-05 13:25:24 +01:00
Milan Hanajik 00e0bc5ab7 Warsaw-END : (1) FMFreq[] array size changed to 4, (2) Component upgraded (component 161202-2), ver. 2.12.399 2016-12-02 15:01:44 +01:00
Milan Hanajik e69836b03c TBF : Type-safe structured queries used everywhere, ver. 2.12.397 2016-12-02 12:52:30 +01:00
Milan Hanajik ae8ba80f67 (1) Test wizard includes 'Heat meters' step only when HEAT_METERS_SUPPORT defined, (2) type-safe queries. 2016-12-02 11:04:33 +01:00
Milan Hanajik 1f3a2af043 (1) Component wrapper modified for endurance tests (uint CyclePar[]), (2) Warsaw-END line size. 2016-12-02 09:48:47 +01:00
Milan Hanajik 4917b0c0c4 TestMethods.Endurance test method added. 2016-12-02 09:10:17 +01:00
Milan Hanajik cec1816f82 Components can be deleted, component ItemNr-s are updated before saving to DB, ver. 2.12.396 2016-11-30 14:16:51 +01:00
Milan Hanajik 1bc3137d20 ver. 2.12.395 2016-11-28 14:13:09 +01:00
Milan Hanajik ed416e5237 Cevak : Changes in printing, PrintDocumentCevak.cs in Results.Output.Printers only. 2016-11-28 14:12:56 +01:00
Milan Hanajik 37d61658d4 ResultsBrowser : Print -> Drucken, ver. 2.12.393 2016-11-28 10:13:29 +01:00
Milan Hanajik 9d67343e2e Endurance components updated (SLM, Warsaw) 2016-11-28 09:49:27 +01:00
Milan Hanajik 7477a536da ResultsBrowser : Printing a table with statistics, ver. 2.12.392 2016-11-23 14:07:04 +01:00
Milan Hanajik 59c0f73dd2 ver. 2.12.292 2016-11-21 12:38:36 +01:00
Milan Hanajik 02c7ac37f5 Support for WARSAW_END added (define WARSAW_END; LANG_PL) 2016-11-21 11:17:00 +01:00
Milan Hanajik 5114f5f1eb ResultsBrowser : Printing statistics in progress. 2016-11-21 11:03:44 +01:00
Milan Hanajik 0a1966d7bd ResultsBrowser : (1) More safe StatisticsOptionsDlg, (2) ResultsConfigDlg initializes 'Caption', ver. 2.12.392 2016-11-19 00:41:56 +01:00
Milan Hanajik 9b457299ea (1) German : Mounting : 'S' --> 'STR', (2) bug fix in ResultsBrowser Statistics, ver. 2.12.391 2016-11-18 15:46:50 +01:00
Milan Hanajik 8b8c0c09df ResultsBrowser : Time range display function added, ver.2.12.390 2016-11-18 15:18:21 +01:00
Milan Hanajik eb5f3465c8 ResultsBrowser : Statistics : rows and columns are combinations of two items, ver. 2.12.390 2016-11-18 14:15:54 +01:00
Milan Hanajik 1487e7889b ResultsBrowser : (1) clean-up, (2) bug in statistics fixed, (3) captions used to select statistics, ver. 2.12.389 2016-11-18 11:56:22 +01:00
Milan Hanajik 2c0914baf8 PMaxTest, LeakTest : Minor modifications in pressure adjustment steps. 2016-11-18 11:03:44 +01:00
Milan Hanajik b75a8105de MunichPrintDocument : (1) Water pressure in bar, (2) Aux meter data bug fixed, ver. 2.12.388 2016-11-17 11:12:43 +01:00
Milan Hanajik 0a827e0eb6 German translations, LANG_DE introduced, ver. 2.12.387 2016-11-17 10:24:07 +01:00
Milan Hanajik 98a773700e Bug fix related to PressMtrDelta, ver. 2.12.386 2016-11-17 08:48:52 +01:00
Milan Hanajik 2189c2150e Munich3 entry form (single) with 'Disabled' check boxes, ver. 2.12.385 2016-11-17 06:51:15 +01:00
Milan Hanajik 92f77bf6d6 Some localization to German 2016-11-16 22:13:48 +01:00
Milan Hanajik a5799290c9 ResultsBrowser : Synchronized with branch 2.9, ver. 2.12.384 2016-11-16 15:57:23 +01:00
Milan Hanajik 16d471f12e Munich : Previous results form : 'Show' button localization, etc. 2016-11-16 15:28:02 +01:00
Milan Hanajik ec0eecde50 ver. 2.12.384 2016-11-16 13:21:15 +01:00
Milan Hanajik b649c282e8 iPerlST : Modification in writing calibration factors via RFID. 2016-11-10 14:09:02 +01:00
Milan Hanajik 3e6243a8b7 Puchong component upgraded, component date: 27.07.2016 2016-11-04 14:52:49 +01:00
Milan Hanajik 02b29d9553 LU Logging : KorrFehlerXy parameter correctly written to logs. 2016-11-02 13:46:50 +01:00
Milan Hanajik 04cec33bf6 iPerlCommunication : "Normalize calibration factor" activity added. 2016-11-02 13:34:04 +01:00
Milan Hanajik eee5e5dc8c Bug fixes in DataEntry.HeatMeters12 2016-10-29 20:35:48 +02:00
Milan Hanajik 09166ae73c Bug fix in DataEntry.HeatMeters6 2016-10-29 20:31:08 +02:00
Milan Hanajik 52d0c1907f DataEntry.HeatMeters6 and FixedStartMassCollectionSeq bug fixes, ver. 2.12.380 2016-10-28 18:45:43 +02:00
Milan Hanajik 5620ba61fa SensusOracle.Database : Minor changes in LU logging, Utils.DoubleToStr() modifications. 2016-10-27 14:54:37 +02:00
Milan Hanajik 63b5507f78 iPerlCommunication : 250ms delayafter writes, more logging, Opto-Data indication using pictureBoxes fixed. 2016-10-27 14:30:12 +02:00
Milan Hanajik 1ad8a69717 SLM-END component added, master branch modifications for SLM_END and WARSAW_END, ver. 2.12.378 2016-10-26 19:43:56 +02:00
Milan Hanajik 8be072ca52 ver. 2.11.375 2016-10-24 09:11:19 +02:00
Milan Hanajik cdea0e96b6 Malta WSD25 component upgraded, colors of valves changed. 2016-10-19 11:38:52 +02:00
Milan Hanajik bab677c5c2 PressMtrDelta added to BenchPath, PressDeltaXyz added to TestRslt, test methods modified, ver. 2.12.373 2016-10-18 19:14:01 +02:00
Milan Hanajik d1fb0e0f0a T warm/cold lo/hi renamed to T hi/lo min/max 2016-10-18 17:27:24 +02:00
Milan Hanajik 08d854f6f8 Modbus.PressureMeter.Meret implemented, ver. 2.11.372 2016-10-18 17:27:22 +02:00
Milan Hanajik 93e8328940 IModbus and Modbus modification : Supports receiving telegrams from multiple devices. 2016-10-18 17:27:08 +02:00
Milan Hanajik b608fb77b9 DeviceTest saves settings of both components, it's PERFECT !!! 2016-10-18 17:26:48 +02:00
Milan Hanajik 03c027ab33 LogProcessDataHeatMeters, ver. 2.11.371 2016-10-18 11:49:32 +02:00
Milan Hanajik 14de767c52 Modbus.Common.Modbus.SendMessage(byte deviceAddress, byte function, ...) function added. 2016-10-18 11:31:17 +02:00
Milan Hanajik 9e90d3a93f DeviceTest program functional, runs operation Modbus.PressureMeter.Meret.ReadPressureOp(...) 2016-10-18 11:30:02 +02:00
483 changed files with 42272 additions and 13142 deletions
+4
View File
@@ -2,6 +2,8 @@ Config/bin/
Config/obj/
DeviceTest/bin/
DeviceTest/obj/
Dirichlet.Numerics/bin
Dirichlet.Numerics/obj
Results/bin/
Results/obj/
ResultsBrowser/bin/
@@ -10,6 +12,8 @@ TestBenchFramework/bin/
TestBenchFramework/obj/
TBFSetup/Debug/
TBFSetup/Release/
Users/bin/
Users/obj/
Doc/
*.suo
*.bak
+5 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MALTA_WSD25</DefineConstants>
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MALTA_WSD25</DefineConstants>
<DefineConstants>TRACE;MUNICH;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -94,6 +94,7 @@
<Compile Include="Entities\WMType.cs" />
<Compile Include="FluentCommon.cs" />
<Compile Include="Grp.cs" />
<Compile Include="IUser.cs" />
<Compile Include="Mappings\BenchPathMap.cs" />
<Compile Include="Mappings\ComponentMap.cs" />
<Compile Include="Mappings\ComponentProcedureMap.cs" />
@@ -126,9 +127,11 @@
<ItemGroup>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.ru.resx" />
<EmbeddedResource Include="Resources\Strings.zh-CN.resx" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+21 -11
View File
@@ -4,6 +4,10 @@ namespace Config
{
public class Data
{
/// Current user
public static IUser CurrentUser;
public static DateTime LastAuthorization = DateTime.Now;
public const string AdminUsername = "admin";
public const string AdminPassword = "staratura";
public const string SQLiteDbFName = "SQLite.db";
@@ -13,58 +17,64 @@ namespace Config
public const int LineSize = 1;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_VELKA_TRAT
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif TORINO50 || BADGER_MALA_TRAT
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
#elif IPERLST
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_IPERL
public const int WMsCount = 40;
public const int LineSize = 20;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
#elif IPERLST_SPECIAL
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_SPECIAL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_50
public const int WMsCount = 12;
public const int LineSize = 12;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 6;
#elif SLM_END
public const int WMsCount = 12;
public const int LineSize = 6;
public const int MaxPartNr = WMsCount / LineSize;
#elif SLM_END || WARSAW_END
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 4;
#elif MALTA_WSD25
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#endif
public static int MaxPartNr()
{
return Math.Max(WMsCount / LineSize, CompoundWMsCount);
}
///
///
/// Database related: This object reference is set after a successful user login
///
public static DatabaseSettings CurrentBench;
+13 -6
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Text;
@@ -17,14 +17,16 @@ namespace Config
public bool IsRealBench;
public DBSettings ProceduresDBSettings; /// Config database settings
public DBSettings WaterMetersDBSettings; /// Results database settings
public DBSettings UsersDBSettings; /// Users database settings
// Constructor
public DatabaseSettings()
{
BenchName = String.Empty; /// Empty string to avoid null
BenchName = String.Empty; /// Empty string (avoid null)
IsRealBench = false;
ProceduresDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_procedures; UID=root; PASSWORD=;");
WaterMetersDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_watermeters; UID=root; PASSWORD=;");
ProceduresDBSettings = new DBSettings(Entities.DBType.MySql, string.Empty);
WaterMetersDBSettings = new DBSettings(Entities.DBType.MySql, string.Empty);
UsersDBSettings = new DBSettings(Entities.DBType.MySql, string.Empty);
}
public object Clone()
@@ -33,15 +35,20 @@ namespace Config
result.BenchName = BenchName;
result.IsRealBench = IsRealBench;
result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone();
result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone();
result.WaterMetersDBSettings = (DBSettings)WaterMetersDBSettings.Clone();
result.UsersDBSettings = (DBSettings)ProceduresDBSettings.Clone();
return result;
}
public override string ToString()
{
return string.Format("{0} conn.str.={1}", BenchName, ProceduresDBSettings.ConnectionString);
return string.Format("{0} config={1} results={2} users={3}",
BenchName,
ProceduresDBSettings.ConnectionString,
WaterMetersDBSettings.ConnectionString,
UsersDBSettings.ConnectionString);
}
}
}
+21 -18
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -8,15 +8,16 @@ namespace Config.Entities
{
public class BenchPath : IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string TempIn { get; set; }
public virtual string TempOut { get; set; }
public virtual string PressIn { get; set; }
public virtual string PressOut { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string TempMtrUp { get; set; }
public virtual string TempMtrDown { get; set; }
public virtual string PressMtrUp { get; set; }
public virtual string PressMtrDown { get; set; }
public virtual string PressMtrDelta { get; set; }
public virtual string StopBFValve { get; set; }
/// Valves
@@ -27,7 +28,7 @@ namespace Config.Entities
public BenchPath()
{
ValvesOpen = string.Empty;
ValvesOpen = string.Empty;
ValvesClose = string.Empty;
}
@@ -42,14 +43,16 @@ namespace Config.Entities
{
BenchPath result = new BenchPath(name, itemNr);
result.Qfrom = Qfrom;
result.Qto = Qto;
result.TempIn = TempIn;
result.TempOut = TempOut;
result.PressIn = PressIn;
result.PressOut = PressOut;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.TempMtrUp = TempMtrUp;
result.TempMtrDown = TempMtrDown;
result.PressMtrUp = PressMtrUp;
result.PressMtrDown = PressMtrDown;
result.PressMtrDelta = PressMtrDelta;
result.StopBFValve = StopBFValve;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
return result;
}
+102 -32
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -78,6 +78,7 @@ namespace Config.Entities
Compound,
HeatMeterVolume,
HeatMeterEnergy,
SingleOrCompound, /// Only used when querying results
}
public enum Medium
@@ -90,12 +91,20 @@ namespace Config.Entities
public enum Mounting
{
#if LANG_DE
[Description("")] NotSpecified,
[Description("H")] H, /// horizontal
[Description("V")] V, /// vertical
[Description("STR")] S, /// standrohre
[Description("F")] F, /// fall
#else
[Description("")] NotSpecified,
[Description("H")] H, /// horizontal
[Description("V")] V, /// vertical
[Description("S")] S, /// steig
[Description("F")] F, /// fall
Count
#endif
Count
}
public enum TemperatureClass
@@ -164,24 +173,30 @@ namespace Config.Entities
public enum Publish : sbyte
{
#if MUNICH
#if LANG_DE
/// nemecky
[Description("nie")] Never = 0,
[Description("immer")] Always = 1,
[Description("Bildschirm")] OnScreen = 2,
[Description("intern")] Internal = 3,
#elif CEVAK || BADGER_MALA_TRAT || BADGER_VELKA_TRAT
#elif LANG_CS
/// cesky
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interně")] Internal = 3,
#elif IPERLST || IPERLST_SPECIAL || SLM_50
#elif LANG_SK
/// slovensky
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interne")] Internal = 3,
#elif LANG_PL
/// polsky
[Description("nigdy")] Never = 0,
[Description("zawsze")] Always = 1,
[Description("na ekranie")] OnScreen = 2,
[Description("wewnętrznie")] Internal = 3,
#else
[Description("Never")] Never = 0,
[Description("Always")] Always = 1,
@@ -231,37 +246,76 @@ namespace Config.Entities
Count,
}
public enum UnitsVolume
public enum ItemCategory
{
Liter,
CubicMtr,
#if LANG_DE
[Description("Allgemein")] Other,
[Description("Prüfstanddaten")] BenchData,
[Description("Prüfstandergebnisse")] BenchResult,
[Description("Prüfpunktdaten")] TestData,
[Description("Prüfpunktergebnisse")] TestResult,
[Description("Wasserzelledaten")] MeterData,
[Description("Wasserzelleergebnisse")] MeterResult,
#else
[Description("Other")] Other,
[Description("Bench data")] BenchData,
[Description("Bench result")] BenchResult,
[Description("Test data")] TestData,
[Description("Test result")] TestResult,
[Description("Meter data")] MeterData,
[Description("Meter result")] MeterResult,
#endif
Count,
}
/// <summary> Possible modes of operation of components and devices. </summary>
public enum DebugMode
{
DetectedOff = -2,
DetectedOn = -1,
Normal = 0, /// Normal operation
AutoDetect, /// The component (device) will be auto-detected
FailureDuringOperation, /// Failure during operation -> disabled
Off, /// The component is off
Record,
Reply,
Simulate, /// Test bench simulation, this mode does not require any hardware
Inherit,
{
#if LANG_DE
[Description("Erkennen-aus")] DetectedOff = -2,
[Description("Erkennen-ein")] DetectedOn = -1,
[Description("Normal")] Normal = 0, /// Normal operation
[Description("Auto-erkennen")] AutoDetect, /// The component (device) will be auto-detected
[Description("Fehler")] FailureDuringOperation, /// Failure during operation -> disabled
[Description("Aus")] Off, /// The component is off
[Description("Aufzeichnen")] Record,
[Description("Reply")] Reply,
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Geerbt")] Inherit,
#else
[Description("Detected off")] DetectedOff = -2,
[Description("Detected on")] DetectedOn = -1,
[Description("Normal")] Normal = 0, /// Normal operation
[Description("Auto detect")] AutoDetect, /// The component (device) will be auto-detected
[Description("Run-time error")] FailureDuringOperation, /// Failure during operation -> disabled
[Description("Off")] Off, /// The component is off
[Description("Record")] Record,
[Description("Reply")] Reply,
[Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Inherit")] Inherit,
#endif
Count,
}
public enum LogLevel
{
Off,
Fatal,
Error,
Warn,
Info,
Debug,
All,
{
#if LANG_DE
[Description("Aus")] Off,
[Description("Schwerwiegend")] Fatal,
[Description("Fehler")] Error,
[Description("Warnung")] Warn,
[Description("Info")] Info,
[Description("Debug")] Debug,
[Description("Alles")] All,
#else
[Description("Off")] Off,
[Description("Fatal")] Fatal,
[Description("Error")] Error,
[Description("Warn")] Warn,
[Description("Info")] Info,
[Description("Debug")] Debug,
[Description("All")] All,
#endif
Count,
}
@@ -281,12 +335,28 @@ namespace Config.Entities
}
public enum Alignment
{
Left,
Center,
Right,
Justified,
{
#if LANG_DE
[Description("links")] Left,
[Description("zentriert")] Center,
[Description("rechts")] Right,
[Description("angepasst")] Justified,
#else
[Description("Left")] Left,
[Description("Center")] Center,
[Description("Right")] Right,
[Description("Justified")] Justified,
#endif
Count
}
public enum LoginMethod
{
UserName, /// = alias, abbreviation
FullName, /// = description
Number,
Count
}
}
+1 -1
View File
@@ -53,7 +53,7 @@ namespace Config.Entities
///
/// Default values
///
CreationUser = (User.CurrentUser != null) ? User.CurrentUser.Name : null;
CreationUser = (Config.Data.CurrentUser != null) ? Config.Data.CurrentUser.UserName : null;
CreationTime = DateTime.Now;
LastChgUser = CreationUser;
LastChgTime = CreationTime;
+2 -2
View File
@@ -44,7 +44,7 @@ namespace Config.Entities
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
public virtual string MetersPath { get; set; }
#if HEAT_METERS_SUPPORT
#if HEAT_METERS
public virtual string HeatMetersPath { get; set; }
#endif
public virtual string RelTransBefore { get; set; }
@@ -129,7 +129,7 @@ namespace Config.Entities
result.BenchPath = BenchPath;
result.OutputPath = OutputPath;
result.MetersPath = MetersPath;
#if HEAT_METERS_SUPPORT
#if HEAT_METERS
result.HeatMetersPath = HeatMetersPath;
#endif
result.RelTransBefore = RelTransBefore;
+5 -5
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2015, 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -12,7 +12,7 @@ namespace Config.Entities
public virtual int ItemNr { get; set; } /// Order of the preparation step
public virtual int Duration { get; set; } /// Duration in seconds
public virtual string Message { get; set; } /// Message
public virtual StepCondition EndCondition { get; set; } /// Condition when transition step is finished (next to the duration)
public virtual string EndCondition { get; set; } /// Condition when transition step is finished (next to the duration)
public virtual string ValvesOpen { get; set; } /// List of valves to be opened
public virtual string ValvesClose { get; set; } /// List of valves to be closed
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
@@ -24,8 +24,8 @@ namespace Config.Entities
public TransitionStep()
{
Duration = 5; /// sec.
EndCondition = (int)StepCondition.None;
Duration = 5; /// sec.
EndCondition = "None";
}
public TransitionStep(int itemNr, TransitionSequence sequence)
@@ -54,7 +54,7 @@ namespace Config.Entities
result += indent + "ItemNr = " + ItemNr.ToString() + ", ";
result += indent + "Duration = " + Duration.ToString() + ", ";
result += indent + "Message = " + Message + ", ";
result += indent + "EndCondition = " + EndCondition.ToString() + ", ";
result += indent + "EndCondition = " + EndCondition + ", ";
result += indent + "ValvesOpen = " + ValvesOpen + ", ";
result += indent + "ValvesClose = " + ValvesClose + ", ";
result += indent + "RegulValvesPct = " + RegulValvesPct + ", ";
+207 -82
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,15 +11,15 @@ using log4net;
namespace Config.Entities
{
public class User
public class User : IUser
{
static readonly ILog log = LogManager.GetLogger(typeof(User));
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual string UserName { get; set; } /// = name, alias, abbreviation
public virtual string FullName { get; set; } /// = description
public virtual int Number { get; set; }
public virtual string Password { get; set; }
public virtual string Description { get; set; }
public virtual string Password { get; set; }
public virtual DateTime LastPwChange { get; set; }
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
@@ -29,20 +29,20 @@ namespace Config.Entities
{
this.powerUser = false;
Groups = new List<Group>();
#if IPERLST || IPERLST_SPECIAL
#if ORACLE_DB
Number = 6;
#else
Number = 0;
Number = 0;
#endif
}
public User(string name, int number, bool powerUser)
public User(string userName, int number, bool powerUser)
{
Name = name;
UserName = userName;
Number = number;
this.powerUser = powerUser;
Groups = new List<Group>();
Description = "Power user";
FullName = powerUser ? "Power user" : string.Empty;
}
public virtual void AddGroup(Group group)
@@ -52,19 +52,6 @@ namespace Config.Entities
/// ------------- Additional stuff not mapped into the database -------------
///
/// Authorized user (static)
///
private static User currentUser = null; /// Updated by instance methods Authorize, Unauthorize
public static User CurrentUser
{
get { return currentUser; }
set { currentUser = value; }
}
private static DateTime lastAuthorization = DateTime.Now;
public static DateTime LastAuthorization { get { return lastAuthorization; } }
/// <summary>
/// Check whether user is a member of a group.
/// </summary>
@@ -121,59 +108,131 @@ namespace Config.Entities
return (Password == EncryptedPassword(password));
}
/// <summary>
/// The FIRST of TWO possible user authorization method to be used
/// when a specific group membership is required (you can use Grp.GID.None).
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="requiredGrupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool Authorize(string userName, string password, Grp.GID requiredGroupMembership)
{
/// <summary>
/// The FIRST of TWO possible user authorization method to be used
/// when a specific group membership is required (you can use Grp.GID.None).
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="userName">User name</param>
/// <param name="password">Password</param>
/// <param name="requiredGrupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool Authorize(string userName, string password, Grp.GID requiredGroupMembership)
{
if (Entities.User.IsPowerUser(userName, password))
{
currentUser = this;
lastAuthorization = DateTime.Now;
Data.CurrentUser = this;
Data.LastAuthorization = DateTime.Now;
log.FatalFormat("Power user '{0}' authorized @level '{1}'", userName, requiredGroupMembership);
return true;
}
if (Name.ToLower() == userName.ToLower())
{
if (IsMemberOf(requiredGroupMembership) && CheckPassword(password))
{
currentUser = this;
lastAuthorization = DateTime.Now;
if (UserName.ToLower() == userName.ToLower())
{
if (IsMemberOf(requiredGroupMembership) && CheckPassword(password))
{
Data.CurrentUser = this;
Data.LastAuthorization = DateTime.Now;
log.FatalFormat("User '{0}' authorized @level '{1}'", userName, requiredGroupMembership);
return true;
}
else
{
return false;
}
}
return false;
}
}
else
{
return false;
}
}
return false;
}
/// <summary>
/// The SECOND of TWO possible user authorization method to be used when
/// no specific group membership is required.
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="requiredGroupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool Authorize(string userName, string password)
{
return Authorize(userName, password, Grp.GID.None);
}
/// <summary>
/// The SECOND of TWO possible user authorization method to be used when
/// no specific group membership is required.
/// </summary>
public virtual bool Authorize(string userName, string password)
{
return Authorize(userName, password, Grp.GID.None);
}
/// <summary>
/// The FIRST of TWO possible user authorization method to be used
/// when a specific group membership is required (you can use Grp.GID.None).
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="number">User ID number</param>
/// <param name="password">Password</param>
/// <param name="requiredGrupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool AuthorizeNumber(int number, string password, Grp.GID requiredGroupMembership)
{
if (Number == number)
{
if (IsMemberOf(requiredGroupMembership) && CheckPassword(password))
{
Data.CurrentUser = this;
Data.LastAuthorization = DateTime.Now;
log.FatalFormat("User ID={0} authorized @level '{1}'", number, requiredGroupMembership);
return true;
}
else
{
return false;
}
}
return false;
}
/// <summary>
/// The SECOND of TWO possible user authorization method to be used when
/// no specific group membership is required.
/// </summary>
public virtual bool AuthorizeNumber(int number, string password)
{
return AuthorizeNumber(number, password, Grp.GID.None);
}
/// <summary>
/// The FIRST of TWO possible user authorization method to be used
/// when a specific group membership is required (you can use Grp.GID.None).
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="fullName"></param>
/// <param name="password"></param>
/// <param name="requiredGrupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool AuthorizeFullName(string fullName, string password, Grp.GID requiredGroupMembership)
{
if (FullName.ToLower() == fullName.ToLower())
{
if (IsMemberOf(requiredGroupMembership) && CheckPassword(password))
{
Data.CurrentUser = this;
Data.LastAuthorization = DateTime.Now;
log.FatalFormat("User alias={0} authorized @level '{1}'", fullName, requiredGroupMembership);
return true;
}
else
{
return false;
}
}
return false;
}
/// <summary>
/// The SECOND of TWO possible user authorization method to be used when
/// no specific group membership is required.
/// </summary>
public virtual bool AuthorizeFullName(string fullName, string password)
{
return AuthorizeFullName(fullName, password, Grp.GID.None);
}
/// <summary>
/// Returns a 'User' with a given username from a database.
@@ -183,23 +242,24 @@ namespace Config.Entities
public static User AuthorizeDummyUser(string username)
{
User user = new User();
user.Name = username;
currentUser = user;
user.UserName = username;
Data.CurrentUser = user;
return user;
}
/// <summary>
/// Returns a 'User' with a given username from an ARBITRARY database.
/// </summary>
/// <param name="username">User name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByName(string username, DBSettings dbSettings)
public static User LoadUserByName(string userName, DBSettings dbSettings)
{
IList<User> listOfUsers = FluentCommon.CreateSessionFactory(DBKind.Config, dbSettings, false)
.OpenSession()
.CreateQuery("FROM User WHERE LOWER(Name) = :username")
.SetParameter("username", username.ToLower())
.List<User>();
.OpenSession()
.CreateQuery("FROM User WHERE LOWER(UserName) = :username") /// Note: QueryOver<User>().Where(x => x.UserName.ToLower() == ... does not work
.SetParameter("username", userName.ToLower())
.List<User>();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
@@ -209,16 +269,81 @@ namespace Config.Entities
/// </summary>
/// <param name="username">User name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByName(string username)
public static User LoadUserByName(string userName)
{
IList<User> listOfUsers = FluentCommon.CreateSession(DBKind.Config)
.CreateQuery("FROM User WHERE LOWER(Name) = :username")
.SetParameter("username", username.ToLower())
.List<User>();
.CreateQuery("FROM User WHERE LOWER(UserName) = :username") /// Note: QueryOver<User>().Where(x => x.UserName.ToLower() == ... does not work
.SetParameter("username", userName.ToLower())
.List<User>();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// Returns a 'User' with a given full name from an ARBITRARY database.
/// </summary>
/// <param name="fullName">Full name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByFullName(string fullName, Config.DBSettings dbSettings)
{
IList<User> listOfUsers = FluentCommon.CreateSessionFactory(DBKind.Config, dbSettings, false)
.OpenSession()
.CreateQuery("FROM User WHERE LOWER(Description) = :fullname") /// Note: QueryOver<User>().Where(x => x.FullName.ToLower() == ... does not work
.SetParameter("fullname", fullName.ToLower())
.List<User>();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// Returns a 'User' with a given full name from the users database.
/// </summary>
/// <param name="fullName">Full name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByFullName(string fullName)
{
IList<User> listOfUsers = FluentCommon.CreateSession(DBKind.Config)
.CreateQuery("FROM User WHERE LOWER(Description) = :fullname") /// Note: QueryOver<User>().Where(x => x.FullName.ToLower() == ... does not work
.SetParameter("fullname", fullName.ToLower())
.List<User>();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// Returns a 'User' with a given username from an ARBITRARY database.
/// </summary>
/// <param name="number">User ID number for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByNumber(int number, Config.DBSettings dbSettings)
{
IList<User> listOfUsers = FluentCommon.CreateSessionFactory(DBKind.Config, dbSettings, false)
.OpenSession()
.QueryOver<User>()
.Where(x => (x.Number == number))
.List();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// Returns a 'User' with a given username from the users database.
/// </summary>
/// <param name="number">User ID number for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByNumber(int number)
{
IList<User> listOfUsers = FluentCommon.CreateSession(DBKind.Config)
.QueryOver<User>()
.Where(x => (x.Number == number))
.List();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// returns an IList of all Users
/// </summary>
@@ -235,8 +360,8 @@ namespace Config.Entities
/// </summary>
public static void Unauthorize()
{
currentUser = null;
lastAuthorization = DateTime.Now;
Data.CurrentUser = null;
Data.LastAuthorization = DateTime.Now;
}
/// <summary>
@@ -267,10 +392,10 @@ namespace Config.Entities
{
return (userName.Equals("milan") && password.Equals("napajedla")) ||
(userName.Equals("igor") && password.Equals("ronko4")) ||
(userName.Equals("janb") && password.Equals("sen345bnaj21")) ||
(userName.Equals("vlado") && password.Equals("luskovica.430")) ||
(userName.Equals("pakan") && password.Equals("kuriatko")) ||
(userName.Equals("gilles") && password.Equals("alibaba"));
(userName.Equals("evinic") && password.Equals("stivik55")) ||
(userName.Equals("gilles") && password.Equals("alibaba"));
}
}
}
+1 -1
View File
@@ -41,7 +41,7 @@ namespace Config.Entities
WMType procedure = new WMType()
{
CreateTime = DateTime.Now,
CreateUserName = User.CurrentUser.Name,
CreateUserName = Config.Data.CurrentUser.UserName,
CreateDescription = "A default water meter created.",
Name = "Watermeter",
PulseRate = 1000,
+2 -2
View File
@@ -182,8 +182,8 @@ namespace Config
/// Create the user 'admin' add his groups
var admin = new Entities.User
{
Name = Data.AdminUsername,
Description = Strings.Administrator,
UserName = Data.AdminUsername,
FullName = Strings.Administrator,
LastPwChange = DateTime.Now
};
admin.SetPassword(Data.AdminPassword);
+26
View File
@@ -0,0 +1,26 @@
using System;
namespace Config
{
public interface IUser
{
string UserName { get; }
string FullName { get; }
int Number { get; }
bool IsMemberOf(Grp.GID group);
bool Authorize(string userName, string password);
bool Authorize(string userName, string password, Grp.GID requiredGroup);
bool AuthorizeFullName(string fullName, string password);
bool AuthorizeFullName(string fullName, string password, Grp.GID requiredGroup);
bool AuthorizeNumber(int number, string password);
bool AuthorizeNumber(int number, string password, Grp.GID requiredGroup);
//IUser LoadUserByName(string username, DBSettings dbSettings);
//IUser LoadUserByFullName(string alias, DBSettings dbSettings);
//IUser LoadUserByNumber(int number, DBSettings dbSettings);
}
}
+5 -4
View File
@@ -15,10 +15,11 @@ namespace Config.Mappings
Map(x => x.Name);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.TempIn);
Map(x => x.TempOut);
Map(x => x.PressIn);
Map(x => x.PressOut);
Map(x => x.TempMtrUp).Column("TempIn");
Map(x => x.TempMtrDown).Column("TempOut");
Map(x => x.PressMtrUp).Column("PressIn");
Map(x => x.PressMtrDown).Column("PressOut");
Map(x => x.PressMtrDelta);
Map(x => x.StopBFValve);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
+1 -1
View File
@@ -6,7 +6,7 @@ using Config.Entities;
namespace Config.Mappings
{
#if HEAT_METERS_SUPPORT
#if HEAT_METERS
class HeatMetersPathMap : ClassMap<HeatMetersPath>
{
public HeatMetersPathMap()
+1 -1
View File
@@ -44,7 +44,7 @@ namespace Config.Mappings
Map(x => x.BenchPath);
Map(x => x.OutputPath);
Map(x => x.MetersPath);
#if HEAT_METERS_SUPPORT
#if HEAT_METERS
Map(x => x.HeatMetersPath);
#endif
Map(x => x.RelTransBefore);
+2 -2
View File
@@ -10,10 +10,10 @@ namespace Config.Mappings
public UserMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.UserName).Column("Name");
Map(x => x.Number);
Map(x => x.Password);
Map(x => x.Description);
Map(x => x.FullName).Column("Description");
Map(x => x.LastPwChange);
HasMany(x => x.Groups)
.Cascade.All();
+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.11.368.0")]
[assembly: AssemblyFileVersion("2.11.368.0")]
[assembly: AssemblyVersion("2.12.486.0")]
[assembly: AssemblyFileVersion("2.12.486.0")]
+153
View File
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Specjalista ds. kalibracji</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Kierownik Laboratorium</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Konserwator</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Metrolog</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Pracownik przeprowadzający testy</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Specjalista ds. testów</value>
</data>
<data name="Failed" xml:space="preserve">
<value>Niepowodzenie</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
</data>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Nie można otworzyć \\r\\nCause:\\r\\n{0}</value>
</data>
<data name="Error" xml:space="preserve">
<value>Błąd</value>
</data>
</root>
+153
View File
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Администратор</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Специалист по калибровке</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Руководитель лаборатории</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Специалист по техобслуживанию</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Метролог</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Контролер</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Специалист по тестированию</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>OK</value>
</data>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Не удается открыть БД.\\r\\nCause:\\r\\n{0}</value>
</data>
<data name="Error" xml:space="preserve">
<value>Ошибка</value>
</data>
</root>
+81 -19
View File
@@ -9,7 +9,7 @@ namespace Config
{
public enum Unit
{
None,
[Description("---")] None,
[Description("l")] l, /// * 1 liter
[Description("m3")] m3, /// 1000 l
@@ -71,26 +71,88 @@ namespace Config
public enum Quantity
{
/// Quantities with units and conversions (double -> double)
[Description("Volume")] Volume,
[Description("Flow")] Flow,
[Description("Mass")] Mass,
[Description("Time")] Time,
[Description("Temperature")] Temperature,
[Description("Pressure")] Pressure,
[Description("Humidity")] Humidity,
[Description("Error")] Error,
[Description("Length")] Length,
[Description("Density")] Density,
[Description("Energy")] Energy,
[Description("Pulse/l")] PulsePerLtr,
[Description("Pulse/kWh")] PulsePerKWh,
#if LANG_DE
[Description("Volumen")] Volume,
[Description("Durchfluss")] Flow,
[Description("Masse")] Mass,
[Description("Zeit")] Time,
[Description("Temperatur")] Temperature,
[Description("Druck")] Pressure,
[Description("Feuchtigkeit")] Humidity,
[Description("Fehler")] Error,
[Description("Länge")] Length,
[Description("Dichte")] Density,
[Description("Energie")] Energy,
[Description("Impulse/l")] PulsePerLtr,
[Description("Impulse/kWh")] PulsePerKWh,
/// Quantities without units and conversions
[Description("Number")] Number,
[Description("String")] String,
[Description("Boolean")] Boolean,
[Description("Date and time")] DateTime,
Count,
[Description("Nummer")] Number,
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum und Uhrzeit")] DateTime,
#elif LANG_PL
[Description("Objętość")] Volume,
[Description("Przepływ")] Flow,
[Description("Masa")] Mass,
[Description("Czas")] Time,
[Description("Temperatura")] Temperature,
[Description("Ciśnienie")] Pressure,
[Description("Wilgotność")] Humidity,
[Description("Błąd")] Error,
[Description("Długość")] Length,
[Description("Gęstość")] Density,
[Description("Energia")] Energy,
[Description("Impulsy/litr")] PulsePerLtr,
[Description("Impulsy/kWh")] PulsePerKWh,
/// Quantities without units and conversions
[Description("Numer")] Number,
[Description("Tekst")] String,
[Description("Boolean")] Boolean,
[Description("Data i czas")] DateTime,
#elif LANG_CS
[Description("Objem")] Volume,
[Description("Průtok")] Flow,
[Description("Hmotnost")] Mass,
[Description("Čas")] Time,
[Description("Teplota")] Temperature,
[Description("Tlak")] Pressure,
[Description("Vlhkost")] Humidity,
[Description("Chyba")] Error,
[Description("Délka")] Length,
[Description("Hustota")] Density,
[Description("Energie")] Energy,
[Description("Pulzy/litr")] PulsePerLtr,
[Description("Pulzy/kWh")] PulsePerKWh,
/// Quantities without units and conversions
[Description("Počet")] Number,
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum a čas")] DateTime,
#else
[Description("Volume")] Volume,
[Description("Flow")] Flow,
[Description("Mass")] Mass,
[Description("Time")] Time,
[Description("Temperature")] Temperature,
[Description("Pressure")] Pressure,
[Description("Humidity")] Humidity,
[Description("Error")] Error,
[Description("Length")] Length,
[Description("Density")] Density,
[Description("Energy")] Energy,
[Description("Pulses/liter")] PulsePerLtr,
[Description("Pulses/kWh")] PulsePerKWh,
/// Quantities without units and conversions
[Description("Number")] Number,
[Description("String")] String,
[Description("Boolean")] Boolean,
[Description("Date and time")] DateTime,
#endif
Count,
}
public static class Units
+5
View File
@@ -38,6 +38,10 @@
<StartupObject>DeviceTest.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -56,6 +60,7 @@
<Compile Include="DeviceTestDlg.Designer.cs">
<DependentUpon>DeviceTestDlg.cs</DependentUpon>
</Compile>
<Compile Include="LocalSettings.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="DeviceTestDlg.resx">
+417 -69
View File
@@ -34,17 +34,45 @@
this.parentNameTextBox = new System.Windows.Forms.TextBox();
this.configureParentButton = new System.Windows.Forms.Button();
this.startButton = new System.Windows.Forms.Button();
this.stopButton = new System.Windows.Forms.Button();
this.initializeButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.configureButton = new System.Windows.Forms.Button();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.configureComponent1Button = new System.Windows.Forms.Button();
this.componentNameTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.classNameComboBox = new System.Windows.Forms.ComboBox();
this.component1ClassNameComboBox = new System.Windows.Forms.ComboBox();
this.radioButton4 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton0 = new System.Windows.Forms.RadioButton();
this.stopButton = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.configureComponent2Button = new System.Windows.Forms.Button();
this.component2NameTextBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.component2ClassNameComboBox = new System.Windows.Forms.ComboBox();
this.radioButton24 = new System.Windows.Forms.RadioButton();
this.radioButton23 = new System.Windows.Forms.RadioButton();
this.radioButton22 = new System.Windows.Forms.RadioButton();
this.radioButton21 = new System.Windows.Forms.RadioButton();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.radioButton34 = new System.Windows.Forms.RadioButton();
this.radioButton33 = new System.Windows.Forms.RadioButton();
this.radioButton32 = new System.Windows.Forms.RadioButton();
this.radioButton31 = new System.Windows.Forms.RadioButton();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.configureComponent3Button = new System.Windows.Forms.Button();
this.component3NameTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.component3ClassNameComboBox = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox5.SuspendLayout();
this.SuspendLayout();
//
// parentClassNameComboBox
@@ -83,9 +111,9 @@
//
// configureParentButton
//
this.configureParentButton.Location = new System.Drawing.Point(77, 68);
this.configureParentButton.Location = new System.Drawing.Point(395, 19);
this.configureParentButton.Name = "configureParentButton";
this.configureParentButton.Size = new System.Drawing.Size(129, 28);
this.configureParentButton.Size = new System.Drawing.Size(73, 45);
this.configureParentButton.TabIndex = 4;
this.configureParentButton.Text = "Configure";
this.configureParentButton.UseVisualStyleBackColor = true;
@@ -93,34 +121,15 @@
//
// startButton
//
this.startButton.Location = new System.Drawing.Point(89, 273);
this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.startButton.Location = new System.Drawing.Point(520, 19);
this.startButton.Name = "startButton";
this.startButton.Size = new System.Drawing.Size(129, 28);
this.startButton.TabIndex = 5;
this.startButton.Text = "Start device";
this.startButton.Size = new System.Drawing.Size(73, 45);
this.startButton.TabIndex = 7;
this.startButton.Text = "Start";
this.startButton.UseVisualStyleBackColor = true;
this.startButton.Click += new System.EventHandler(this.startButton_Click);
//
// stopButton
//
this.stopButton.Location = new System.Drawing.Point(89, 307);
this.stopButton.Name = "stopButton";
this.stopButton.Size = new System.Drawing.Size(129, 28);
this.stopButton.TabIndex = 6;
this.stopButton.Text = "Stop device";
this.stopButton.UseVisualStyleBackColor = true;
this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
//
// initializeButton
//
this.initializeButton.Location = new System.Drawing.Point(89, 239);
this.initializeButton.Name = "initializeButton";
this.initializeButton.Size = new System.Drawing.Size(129, 28);
this.initializeButton.TabIndex = 7;
this.initializeButton.Text = "Start";
this.initializeButton.UseVisualStyleBackColor = true;
this.initializeButton.Click += new System.EventHandler(this.initializeButton_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.configureParentButton);
@@ -130,42 +139,42 @@
this.groupBox1.Controls.Add(this.parentClassNameComboBox);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(405, 106);
this.groupBox1.Size = new System.Drawing.Size(486, 75);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Parent component";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.configureButton);
this.groupBox2.Controls.Add(this.nameTextBox);
this.groupBox2.Controls.Add(this.configureComponent1Button);
this.groupBox2.Controls.Add(this.componentNameTextBox);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.classNameComboBox);
this.groupBox2.Location = new System.Drawing.Point(12, 127);
this.groupBox2.Controls.Add(this.component1ClassNameComboBox);
this.groupBox2.Location = new System.Drawing.Point(12, 93);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(405, 106);
this.groupBox2.Size = new System.Drawing.Size(486, 75);
this.groupBox2.TabIndex = 9;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Component";
this.groupBox2.Text = "Component 1";
//
// configureButton
// configureComponentButton
//
this.configureButton.Location = new System.Drawing.Point(77, 68);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(129, 28);
this.configureButton.TabIndex = 4;
this.configureButton.Text = "Configure";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
this.configureComponent1Button.Location = new System.Drawing.Point(395, 19);
this.configureComponent1Button.Name = "configureComponentButton";
this.configureComponent1Button.Size = new System.Drawing.Size(73, 45);
this.configureComponent1Button.TabIndex = 4;
this.configureComponent1Button.Text = "Configure";
this.configureComponent1Button.UseVisualStyleBackColor = true;
this.configureComponent1Button.Click += new System.EventHandler(this.configureComponent1Button_Click);
//
// nameTextBox
// componentNameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(77, 44);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(299, 20);
this.nameTextBox.TabIndex = 3;
this.componentNameTextBox.Enabled = false;
this.componentNameTextBox.Location = new System.Drawing.Point(77, 44);
this.componentNameTextBox.Name = "componentNameTextBox";
this.componentNameTextBox.Size = new System.Drawing.Size(299, 20);
this.componentNameTextBox.TabIndex = 3;
//
// label1
//
@@ -185,31 +194,345 @@
this.label2.TabIndex = 1;
this.label2.Text = "Class";
//
// classNameComboBox
// componentClassNameComboBox
//
this.classNameComboBox.FormattingEnabled = true;
this.classNameComboBox.Location = new System.Drawing.Point(77, 19);
this.classNameComboBox.Name = "classNameComboBox";
this.classNameComboBox.Size = new System.Drawing.Size(299, 21);
this.classNameComboBox.TabIndex = 0;
this.component1ClassNameComboBox.FormattingEnabled = true;
this.component1ClassNameComboBox.Location = new System.Drawing.Point(77, 19);
this.component1ClassNameComboBox.Name = "componentClassNameComboBox";
this.component1ClassNameComboBox.Size = new System.Drawing.Size(299, 21);
this.component1ClassNameComboBox.TabIndex = 0;
//
// radioButton4
//
this.radioButton4.AutoSize = true;
this.radioButton4.Location = new System.Drawing.Point(13, 118);
this.radioButton4.Name = "radioButton4";
this.radioButton4.Size = new System.Drawing.Size(51, 17);
this.radioButton4.TabIndex = 9;
this.radioButton4.TabStop = true;
this.radioButton4.Text = "spare";
this.radioButton4.UseVisualStyleBackColor = true;
this.radioButton4.CheckedChanged += new System.EventHandler(this.radioButton4_CheckedChanged);
//
// radioButton3
//
this.radioButton3.AutoSize = true;
this.radioButton3.Location = new System.Drawing.Point(13, 95);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(51, 17);
this.radioButton3.TabIndex = 8;
this.radioButton3.TabStop = true;
this.radioButton3.Text = "spare";
this.radioButton3.UseVisualStyleBackColor = true;
this.radioButton3.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged);
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(13, 72);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(51, 17);
this.radioButton2.TabIndex = 7;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "spare";
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Location = new System.Drawing.Point(13, 49);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(106, 17);
this.radioButton1.TabIndex = 6;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "ReadPressureOp";
this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// radioButton0
//
this.radioButton0.AutoSize = true;
this.radioButton0.Location = new System.Drawing.Point(13, 26);
this.radioButton0.Name = "radioButton0";
this.radioButton0.Size = new System.Drawing.Size(94, 17);
this.radioButton0.TabIndex = 5;
this.radioButton0.TabStop = true;
this.radioButton0.Text = "Stop operation";
this.radioButton0.UseVisualStyleBackColor = true;
this.radioButton0.CheckedChanged += new System.EventHandler(this.radioButton0_CheckedChanged);
//
// stopButton
//
this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.stopButton.Location = new System.Drawing.Point(520, 77);
this.stopButton.Name = "stopButton";
this.stopButton.Size = new System.Drawing.Size(73, 45);
this.stopButton.TabIndex = 10;
this.stopButton.Text = "Stop";
this.stopButton.UseVisualStyleBackColor = true;
this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.configureComponent2Button);
this.groupBox3.Controls.Add(this.component2NameTextBox);
this.groupBox3.Controls.Add(this.label3);
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Controls.Add(this.component2ClassNameComboBox);
this.groupBox3.Location = new System.Drawing.Point(12, 174);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(486, 75);
this.groupBox3.TabIndex = 11;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Component 2";
//
// configureComponent2Button
//
this.configureComponent2Button.Location = new System.Drawing.Point(395, 19);
this.configureComponent2Button.Name = "configureComponent2Button";
this.configureComponent2Button.Size = new System.Drawing.Size(73, 45);
this.configureComponent2Button.TabIndex = 4;
this.configureComponent2Button.Text = "Configure";
this.configureComponent2Button.UseVisualStyleBackColor = true;
this.configureComponent2Button.Click += new System.EventHandler(this.configureComponent2Button_Click);
//
// component2NameTextBox
//
this.component2NameTextBox.Enabled = false;
this.component2NameTextBox.Location = new System.Drawing.Point(77, 44);
this.component2NameTextBox.Name = "component2NameTextBox";
this.component2NameTextBox.Size = new System.Drawing.Size(299, 20);
this.component2NameTextBox.TabIndex = 3;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(11, 47);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(35, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Name";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(11, 22);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 13);
this.label4.TabIndex = 1;
this.label4.Text = "Class";
//
// component2ClassNameComboBox
//
this.component2ClassNameComboBox.FormattingEnabled = true;
this.component2ClassNameComboBox.Location = new System.Drawing.Point(77, 19);
this.component2ClassNameComboBox.Name = "component2ClassNameComboBox";
this.component2ClassNameComboBox.Size = new System.Drawing.Size(299, 21);
this.component2ClassNameComboBox.TabIndex = 0;
//
// radioButton24
//
this.radioButton24.AutoSize = true;
this.radioButton24.Location = new System.Drawing.Point(212, 118);
this.radioButton24.Name = "radioButton24";
this.radioButton24.Size = new System.Drawing.Size(51, 17);
this.radioButton24.TabIndex = 9;
this.radioButton24.TabStop = true;
this.radioButton24.Text = "spare";
this.radioButton24.UseVisualStyleBackColor = true;
this.radioButton24.CheckedChanged += new System.EventHandler(this.radioButton24_CheckedChanged);
//
// radioButton23
//
this.radioButton23.AutoSize = true;
this.radioButton23.Location = new System.Drawing.Point(212, 95);
this.radioButton23.Name = "radioButton23";
this.radioButton23.Size = new System.Drawing.Size(51, 17);
this.radioButton23.TabIndex = 8;
this.radioButton23.TabStop = true;
this.radioButton23.Text = "spare";
this.radioButton23.UseVisualStyleBackColor = true;
this.radioButton23.CheckedChanged += new System.EventHandler(this.radioButton23_CheckedChanged);
//
// radioButton22
//
this.radioButton22.AutoSize = true;
this.radioButton22.Location = new System.Drawing.Point(212, 72);
this.radioButton22.Name = "radioButton22";
this.radioButton22.Size = new System.Drawing.Size(51, 17);
this.radioButton22.TabIndex = 7;
this.radioButton22.TabStop = true;
this.radioButton22.Text = "spare";
this.radioButton22.UseVisualStyleBackColor = true;
this.radioButton22.CheckedChanged += new System.EventHandler(this.radioButton22_CheckedChanged);
//
// radioButton21
//
this.radioButton21.AutoSize = true;
this.radioButton21.Location = new System.Drawing.Point(212, 49);
this.radioButton21.Name = "radioButton21";
this.radioButton21.Size = new System.Drawing.Size(106, 17);
this.radioButton21.TabIndex = 6;
this.radioButton21.TabStop = true;
this.radioButton21.Text = "ReadPressureOp";
this.radioButton21.UseVisualStyleBackColor = true;
this.radioButton21.CheckedChanged += new System.EventHandler(this.radioButton21_CheckedChanged);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.radioButton34);
this.groupBox4.Controls.Add(this.radioButton33);
this.groupBox4.Controls.Add(this.radioButton32);
this.groupBox4.Controls.Add(this.radioButton31);
this.groupBox4.Controls.Add(this.radioButton24);
this.groupBox4.Controls.Add(this.radioButton4);
this.groupBox4.Controls.Add(this.radioButton23);
this.groupBox4.Controls.Add(this.radioButton0);
this.groupBox4.Controls.Add(this.radioButton22);
this.groupBox4.Controls.Add(this.radioButton3);
this.groupBox4.Controls.Add(this.radioButton21);
this.groupBox4.Controls.Add(this.radioButton1);
this.groupBox4.Controls.Add(this.radioButton2);
this.groupBox4.Location = new System.Drawing.Point(12, 349);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(581, 145);
this.groupBox4.TabIndex = 12;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Operations";
//
// radioButton34
//
this.radioButton34.AutoSize = true;
this.radioButton34.Location = new System.Drawing.Point(405, 118);
this.radioButton34.Name = "radioButton34";
this.radioButton34.Size = new System.Drawing.Size(51, 17);
this.radioButton34.TabIndex = 13;
this.radioButton34.TabStop = true;
this.radioButton34.Text = "spare";
this.radioButton34.UseVisualStyleBackColor = true;
this.radioButton34.CheckedChanged += new System.EventHandler(this.radioButton34_CheckedChanged);
//
// radioButton33
//
this.radioButton33.AutoSize = true;
this.radioButton33.Location = new System.Drawing.Point(405, 95);
this.radioButton33.Name = "radioButton33";
this.radioButton33.Size = new System.Drawing.Size(51, 17);
this.radioButton33.TabIndex = 12;
this.radioButton33.TabStop = true;
this.radioButton33.Text = "spare";
this.radioButton33.UseVisualStyleBackColor = true;
this.radioButton33.CheckedChanged += new System.EventHandler(this.radioButton33_CheckedChanged);
//
// radioButton32
//
this.radioButton32.AutoSize = true;
this.radioButton32.Location = new System.Drawing.Point(405, 72);
this.radioButton32.Name = "radioButton32";
this.radioButton32.Size = new System.Drawing.Size(51, 17);
this.radioButton32.TabIndex = 11;
this.radioButton32.TabStop = true;
this.radioButton32.Text = "spare";
this.radioButton32.UseVisualStyleBackColor = true;
this.radioButton32.CheckedChanged += new System.EventHandler(this.radioButton32_CheckedChanged);
//
// radioButton31
//
this.radioButton31.AutoSize = true;
this.radioButton31.Location = new System.Drawing.Point(405, 49);
this.radioButton31.Name = "radioButton31";
this.radioButton31.Size = new System.Drawing.Size(106, 17);
this.radioButton31.TabIndex = 10;
this.radioButton31.TabStop = true;
this.radioButton31.Text = "ReadPressureOp";
this.radioButton31.UseVisualStyleBackColor = true;
this.radioButton31.CheckedChanged += new System.EventHandler(this.radioButton31_CheckedChanged);
//
// groupBox5
//
this.groupBox5.Controls.Add(this.configureComponent3Button);
this.groupBox5.Controls.Add(this.component3NameTextBox);
this.groupBox5.Controls.Add(this.label5);
this.groupBox5.Controls.Add(this.label6);
this.groupBox5.Controls.Add(this.component3ClassNameComboBox);
this.groupBox5.Location = new System.Drawing.Point(12, 255);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(486, 75);
this.groupBox5.TabIndex = 13;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Component 3";
//
// configureComponent3Button
//
this.configureComponent3Button.Location = new System.Drawing.Point(395, 19);
this.configureComponent3Button.Name = "configureComponent3Button";
this.configureComponent3Button.Size = new System.Drawing.Size(73, 45);
this.configureComponent3Button.TabIndex = 4;
this.configureComponent3Button.Text = "Configure";
this.configureComponent3Button.UseVisualStyleBackColor = true;
this.configureComponent3Button.Click += new System.EventHandler(this.configureComponent3Button_Click);
//
// component3NameTextBox
//
this.component3NameTextBox.Enabled = false;
this.component3NameTextBox.Location = new System.Drawing.Point(77, 44);
this.component3NameTextBox.Name = "component3NameTextBox";
this.component3NameTextBox.Size = new System.Drawing.Size(299, 20);
this.component3NameTextBox.TabIndex = 3;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(11, 47);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 13);
this.label5.TabIndex = 2;
this.label5.Text = "Name";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(11, 22);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(32, 13);
this.label6.TabIndex = 1;
this.label6.Text = "Class";
//
// component3ClassNameComboBox
//
this.component3ClassNameComboBox.FormattingEnabled = true;
this.component3ClassNameComboBox.Location = new System.Drawing.Point(77, 19);
this.component3ClassNameComboBox.Name = "component3ClassNameComboBox";
this.component3ClassNameComboBox.Size = new System.Drawing.Size(299, 21);
this.component3ClassNameComboBox.TabIndex = 0;
//
// DeviceTestDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(496, 377);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.initializeButton);
this.Controls.Add(this.groupBox1);
this.ClientSize = new System.Drawing.Size(613, 502);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.stopButton);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.startButton);
this.Controls.Add(this.groupBox1);
this.Name = "DeviceTestDlg";
this.Text = "Device test";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DeviceTestDlg_FormClosing);
this.Load += new System.EventHandler(this.DeviceTestDlg_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.ResumeLayout(false);
}
@@ -220,17 +543,42 @@
private System.Windows.Forms.Label classLabel;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.TextBox parentNameTextBox;
private System.Windows.Forms.Button configureParentButton;
private System.Windows.Forms.Button startButton;
private System.Windows.Forms.Button stopButton;
private System.Windows.Forms.Button initializeButton;
private System.Windows.Forms.Button configureParentButton;
private System.Windows.Forms.Button startButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Button configureComponent1Button;
private System.Windows.Forms.TextBox componentNameTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox classNameComboBox;
private System.Windows.Forms.ComboBox component1ClassNameComboBox;
private System.Windows.Forms.RadioButton radioButton4;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton0;
private System.Windows.Forms.Button stopButton;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.RadioButton radioButton24;
private System.Windows.Forms.RadioButton radioButton23;
private System.Windows.Forms.RadioButton radioButton22;
private System.Windows.Forms.RadioButton radioButton21;
private System.Windows.Forms.Button configureComponent2Button;
private System.Windows.Forms.TextBox component2NameTextBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox component2ClassNameComboBox;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Button configureComponent3Button;
private System.Windows.Forms.TextBox component3NameTextBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox component3ClassNameComboBox;
private System.Windows.Forms.RadioButton radioButton34;
private System.Windows.Forms.RadioButton radioButton33;
private System.Windows.Forms.RadioButton radioButton32;
private System.Windows.Forms.RadioButton radioButton31;
}
}
+715 -83
View File
@@ -1,9 +1,14 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
using TBF.BenchControl.GenericDevices;
using System.Xml.Serialization;
namespace DeviceTest
@@ -13,59 +18,382 @@ namespace DeviceTest
IList<string> compClasses;
IComponentFactory parentFactory;
IComponentFactory componentFactory;
IComponentFactory component1Factory;
IComponentFactory component2Factory;
IComponentFactory component3Factory;
IComponentCfg parentCfg;
IComponentCfg componentCfg;
IComponentCfg component1Cfg;
IComponentCfg component2Cfg;
IComponentCfg component3Cfg;
static IList<TBF.BenchControl.Generic.IComponent> tbfComponents;
static IList<TBF.BenchControl.Generic.IDevice> tbfDevices;
static IList<TBF.BenchControl.Generic.IComponent> tbfComponents;
static TBF.BenchControl.Generic.IComponent tbfComponent1forOp;
static TBF.BenchControl.Generic.IComponent tbfComponent2forOp;
static TBF.BenchControl.Generic.IComponent tbfComponent3forOp;
static Thread workerThread;
static bool workerThreadRunning;
static int activeOperationId;
static IOperation operation1;
static IOperation operation2;
static IOperation operation3;
static IOperation operation4;
static IOperation operation21;
static IOperation operation22;
static IOperation operation23;
static IOperation operation24;
static IOperation operation31;
static IOperation operation32;
static IOperation operation33;
static IOperation operation34;
static TBF.Boxes.FloatBox floatBox;
static Event evnt;
static DeviceTestDlg()
{
floatBox = new TBF.Boxes.FloatBox();
floatBox.Format = "F2";
}
public DeviceTestDlg()
{
InitializeComponent();
compClasses = new List<string>();
foreach (var componentFactory in TbfComponents.Factories)
radioButton0.Checked = true;
stopButton.Enabled = false;
foreach (var componentFactory in TbfComponents.Factories)
{
compClasses.Add(componentFactory.ClassName);
}
}
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
tbfDevices = new List<IDevice>();
}
private void DeviceTestDlg_Load(object sender, EventArgs e)
{
startButton.Enabled = false;
stopButton.Enabled = false;
foreach (var clName in compClasses)
{
parentClassNameComboBox.Items.Add(clName);
classNameComboBox.Items.Add(clName);
component1ClassNameComboBox.Items.Add(clName);
component2ClassNameComboBox.Items.Add(clName);
component3ClassNameComboBox.Items.Add(clName);
}
}
private void configureParentButton_Click(object sender, EventArgs e)
{
bool factoryChanged = false;
bool classNotFound = true;
foreach (var factory in TbfComponents.Factories)
try
{
if (parentClassNameComboBox.Text == factory.ClassName)
if (!string.IsNullOrEmpty(Program.LocalSettings.ParentClassName) &&
!string.IsNullOrEmpty(Program.LocalSettings.ParentName) &&
!string.IsNullOrEmpty(Program.LocalSettings.ParentSettings))
{
if (parentFactory != factory)
FactoryFromClassName(Program.LocalSettings.ParentClassName, ref parentFactory);
using (var reader = new StringReader(Program.LocalSettings.ParentSettings))
{
parentFactory = factory;
factoryChanged = true;
IComponentCfg config = (IComponentCfg)(new XmlSerializer(parentFactory.DefaultConfig().GetType())).Deserialize(reader);
config.Name = Program.LocalSettings.ParentName;
config.ParentName = string.Empty;
config.ItemNr = 0;
config.DebugLevel = Config.Entities.DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug;
config.Corrections = null;
config.Factory = parentFactory;
parentCfg = config;
}
classNotFound = false;
break;
parentClassNameComboBox.Text = Program.LocalSettings.ParentClassName;
parentNameTextBox.Text = Program.LocalSettings.ParentName;
}
}
if (classNotFound)
catch
{
MessageBox.Show("Invalid parent component class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
parentFactory = null;
parentCfg = null;
parentClassNameComboBox.Text = string.Empty;
parentNameTextBox.Text = string.Empty;
}
try
{
if (!string.IsNullOrEmpty(Program.LocalSettings.ComponentClassName) &&
!string.IsNullOrEmpty(Program.LocalSettings.ComponentName) &&
!string.IsNullOrEmpty(Program.LocalSettings.ComponentSettings))
{
FactoryFromClassName(Program.LocalSettings.ComponentClassName, ref component1Factory);
using (var reader = new StringReader(Program.LocalSettings.ComponentSettings))
{
IComponentCfg config = (IComponentCfg)(new XmlSerializer(component1Factory.DefaultConfig().GetType())).Deserialize(reader);
config.Name = Program.LocalSettings.ComponentName;
config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.ComponentParentName) ? string.Empty : Program.LocalSettings.ComponentParentName;
config.ItemNr = 1;
config.DebugLevel = Config.Entities.DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug;
config.Corrections = null;
config.Factory = component1Factory;
component1Cfg = config;
}
component1ClassNameComboBox.Text = Program.LocalSettings.ComponentClassName;
componentNameTextBox.Text = Program.LocalSettings.ComponentName;
UpdateOperations(component1ClassNameComboBox.Text);
}
}
catch
{
component1Factory = null;
component1Cfg = null;
component1ClassNameComboBox.Text = string.Empty;
componentNameTextBox.Text = string.Empty;
}
try
{
if (!string.IsNullOrEmpty(Program.LocalSettings.Component2ClassName) &&
!string.IsNullOrEmpty(Program.LocalSettings.Component2Name) &&
!string.IsNullOrEmpty(Program.LocalSettings.Component2Settings))
{
FactoryFromClassName(Program.LocalSettings.Component2ClassName, ref component2Factory);
using (var reader = new StringReader(Program.LocalSettings.Component2Settings))
{
IComponentCfg config = (IComponentCfg)(new XmlSerializer(component2Factory.DefaultConfig().GetType())).Deserialize(reader);
config.Name = Program.LocalSettings.Component2Name;
config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.Component2ParentName) ? string.Empty : Program.LocalSettings.Component2ParentName;
config.ItemNr = 2;
config.DebugLevel = Config.Entities.DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug;
config.Corrections = null;
config.Factory = component2Factory;
component2Cfg = config;
}
component2ClassNameComboBox.Text = Program.LocalSettings.Component2ClassName;
component2NameTextBox.Text = Program.LocalSettings.Component2Name;
UpdateOperations2(component2ClassNameComboBox.Text);
}
}
catch
{
component2Factory = null;
component2Cfg = null;
component2ClassNameComboBox.Text = string.Empty;
component2NameTextBox.Text = string.Empty;
}
try
{
if (!string.IsNullOrEmpty(Program.LocalSettings.Component3ClassName) &&
!string.IsNullOrEmpty(Program.LocalSettings.Component3Name) &&
!string.IsNullOrEmpty(Program.LocalSettings.Component3Settings))
{
FactoryFromClassName(Program.LocalSettings.Component3ClassName, ref component3Factory);
using (var reader = new StringReader(Program.LocalSettings.Component3Settings))
{
IComponentCfg config = (IComponentCfg)(new XmlSerializer(component3Factory.DefaultConfig().GetType())).Deserialize(reader);
config.Name = Program.LocalSettings.Component3Name;
config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.Component3ParentName) ? string.Empty : Program.LocalSettings.Component3ParentName;
config.ItemNr = 3;
config.DebugLevel = Config.Entities.DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug;
config.Corrections = null;
config.Factory = component3Factory;
component3Cfg = config;
}
component3ClassNameComboBox.Text = Program.LocalSettings.Component3ClassName;
component3NameTextBox.Text = Program.LocalSettings.Component3Name;
UpdateOperations3(component3ClassNameComboBox.Text);
}
}
catch
{
component3Factory = null;
component3Cfg = null;
component3ClassNameComboBox.Text = string.Empty;
component3NameTextBox.Text = string.Empty;
}
}
void SaveSettings()
{
Program.LocalSettings.ParentClassName = parentClassNameComboBox.Text;
Program.LocalSettings.ParentName = parentNameTextBox.Text;
Program.LocalSettings.ParentSettings = (parentCfg != null) ? parentCfg.CreateDbEntity().Parameters : string.Empty;
Program.LocalSettings.ComponentClassName = component1ClassNameComboBox.Text;
Program.LocalSettings.ComponentName = componentNameTextBox.Text;
Program.LocalSettings.ComponentParentName = (component1Cfg != null) ? component1Cfg.ParentName : string.Empty;
Program.LocalSettings.ComponentSettings = (component1Cfg != null) ? component1Cfg.CreateDbEntity().Parameters : string.Empty;
Program.LocalSettings.Component2ClassName = component2ClassNameComboBox.Text;
Program.LocalSettings.Component2Name = component2NameTextBox.Text;
Program.LocalSettings.Component2ParentName = (component2Cfg != null) ? component2Cfg.ParentName : string.Empty;
Program.LocalSettings.Component2Settings = (component2Cfg != null) ? component2Cfg.CreateDbEntity().Parameters : string.Empty;
Program.LocalSettings.Component3ClassName = component3ClassNameComboBox.Text;
Program.LocalSettings.Component3Name = component3NameTextBox.Text;
Program.LocalSettings.Component3ParentName = (component3Cfg != null) ? component3Cfg.ParentName : string.Empty;
Program.LocalSettings.Component3Settings = (component3Cfg != null) ? component3Cfg.CreateDbEntity().Parameters : string.Empty;
Program.LocalSettings.Save();
}
void UpdateOperations(string className)
{
if (className == "Keithley.TempMeter") radioButton1.Text = "ReadPressureOp";
else if (className == "Network.Camera.CLP1611") radioButton1.Text = "Livestream";
else if (className == "Network.Camera.Roi") radioButton1.Text = "RoiDetection";
else if (className == "Modbus.Easytherm")
{
radioButton1.Text = "SetTemperature(10)";
radioButton2.Text = "SetTemperature(20)";
radioButton3.Text = "GetSomethig(0,1)";
}
else if (className == "Modbus.TankSelector")
{
radioButton1.Text = "SelectTank 1";
radioButton2.Text = "SelectTank 2";
radioButton3.Text = "SelectTank 3";
radioButton4.Text = "SelectTank -";
}
else radioButton1.Text = "spare";
}
///
void UpdateOperations2(string className)
{
if (className == "Keithley.TempMeter") radioButton21.Text = "ReadPressureOp";
else if (className == "Network.Camera.CLP1611") radioButton21.Text = "Livestream";
else if (className == "Network.Camera.Roi") radioButton21.Text = "RoiDetection";
else if (className == "Modbus.Easytherm")
{
radioButton21.Text = "SetTemperature(10)";
radioButton22.Text = "SetTemperature(20)";
radioButton23.Text = "GetSomethig(0,1)";
}
else if (className == "Modbus.TankSelector")
{
radioButton21.Text = "SelectTank 1";
radioButton22.Text = "SelectTank 2";
radioButton23.Text = "SelectTank 3";
radioButton24.Text = "SelectTank -";
}
else radioButton21.Text = "spare";
}
///
void UpdateOperations3(string className)
{
if (className == "Keithley.TempMeter") radioButton31.Text = "ReadPressureOp";
else if (className == "Network.Camera.CLP1611") radioButton31.Text = "Livestream";
else if (className == "Network.Camera.Roi") radioButton31.Text = "RoiDetection";
else if (className == "Modbus.Easytherm")
{
radioButton31.Text = "SetTemperature(10)";
radioButton32.Text = "SetTemperature(20)";
radioButton33.Text = "GetSomethig(0,1)";
}
else if (className == "Modbus.TankSelector")
{
radioButton31.Text = "SelectTank 1";
radioButton32.Text = "SelectTank 2";
radioButton33.Text = "SelectTank 3";
radioButton34.Text = "SelectTank -";
}
else radioButton31.Text = "spare";
}
int GetActiveOperationId()
{
if (radioButton1.Checked) { return 1; }
else if (radioButton2.Checked) { return 2; }
else if (radioButton3.Checked) { return 3; }
else if (radioButton4.Checked) { return 4; }
else if (radioButton21.Checked) { return 21; }
else if (radioButton22.Checked) { return 22; }
else if (radioButton23.Checked) { return 23; }
else if (radioButton24.Checked) { return 24; }
else if (radioButton31.Checked) { return 31; }
else if (radioButton32.Checked) { return 32; }
else if (radioButton33.Checked) { return 33; }
else if (radioButton34.Checked) { return 34; }
else return 0; /// stopOperationRadioButton.Checked
}
private void radioButton0_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton1_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton2_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton3_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton4_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
///
private void radioButton21_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton22_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton23_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton24_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
///
private void radioButton31_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton32_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton33_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
private void radioButton34_CheckedChanged(object sender, EventArgs e) { activeOperationId = GetActiveOperationId(); }
/// <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>
bool FactoryFromClassName(string className, ref IComponentFactory factory)
{
foreach (var fac in TbfComponents.Factories)
{
if (className == fac.ClassName)
{
if (factory != fac)
{
factory = fac;
return true;
}
else
{
return false;
}
}
}
if (factory != null)
{
factory = null;
return true;
}
return false;
}
private void configureParentButton_Click(object sender, EventArgs e)
{
bool factoryChanged = FactoryFromClassName(parentClassNameComboBox.Text, ref parentFactory);
if (parentFactory == null)
{
MessageBox.Show("Invalid parent class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
@@ -89,35 +417,21 @@ namespace DeviceTest
}
private void configureButton_Click(object sender, EventArgs e)
private void configureComponent1Button_Click(object sender, EventArgs e)
{
bool factoryChanged = false;
bool classNotFound = true;
foreach (var factory in TbfComponents.Factories)
bool factoryChanged = FactoryFromClassName(component1ClassNameComboBox.Text, ref component1Factory);
if (component1Factory == null)
{
if (classNameComboBox.Text == factory.ClassName)
{
if (componentFactory != factory)
{
componentFactory = factory;
factoryChanged = true;
}
classNotFound = false;
break;
}
}
if (classNotFound)
{
MessageBox.Show("Invalid parent component class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Invalid component class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (factoryChanged || componentCfg == null)
if (factoryChanged || component1Cfg == null)
{
componentCfg = componentFactory.DefaultConfig();
component1Cfg = component1Factory.DefaultConfig();
}
IComponentCfgCtrl cfgControl = componentCfg.GetControl();
cfgControl.Config = componentCfg;
IComponentCfgCtrl cfgControl = component1Cfg.GetControl();
cfgControl.Config = component1Cfg;
cfgControl.Config.ItemNr = 1;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
@@ -131,79 +445,397 @@ namespace DeviceTest
DialogResult dr = cfgForm.ShowDialog();
if (dr != DialogResult.OK) return;
nameTextBox.Text = componentCfg.Name;
componentNameTextBox.Text = component1Cfg.Name;
UpdateOperations(component1ClassNameComboBox.Text);
}
private void initializeButton_Click(object sender, EventArgs e)
private void configureComponent2Button_Click(object sender, EventArgs e)
{
tbfComponents = new List<TBF.BenchControl.Generic.IComponent>();
tbfDevices = new List<IDevice>();
bool factoryChanged = FactoryFromClassName(component2ClassNameComboBox.Text, ref component2Factory);
if (component2Factory == null)
{
MessageBox.Show("Invalid component class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (factoryChanged || component2Cfg == null)
{
component2Cfg = component2Factory.DefaultConfig();
}
IComponentCfgCtrl cfgControl = component2Cfg.GetControl();
cfgControl.Config = component2Cfg;
cfgControl.Config.ItemNr = 1;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
///
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
if (component1Factory != null && component1Cfg != null) compEntities.Add(component1Cfg.CreateDbEntity());
cfgForm.TbfComponents = compEntities;
cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true;
DialogResult dr = cfgForm.ShowDialog();
if (dr != DialogResult.OK) return;
component2NameTextBox.Text = component2Cfg.Name;
UpdateOperations2(component2ClassNameComboBox.Text);
}
private void configureComponent3Button_Click(object sender, EventArgs e)
{
bool factoryChanged = FactoryFromClassName(component3ClassNameComboBox.Text, ref component3Factory);
if (component3Factory == null)
{
MessageBox.Show("Invalid component class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (factoryChanged || component3Cfg == null)
{
component3Cfg = component3Factory.DefaultConfig();
}
IComponentCfgCtrl cfgControl = component3Cfg.GetControl();
cfgControl.Config = component3Cfg;
cfgControl.Config.ItemNr = 1;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
///
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
if (component1Factory != null && component1Cfg != null) compEntities.Add(component1Cfg.CreateDbEntity());
if (component2Factory != null && component2Cfg != null) compEntities.Add(component2Cfg.CreateDbEntity());
cfgForm.TbfComponents = compEntities;
cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true;
DialogResult dr = cfgForm.ShowDialog();
if (dr != DialogResult.OK) return;
component3NameTextBox.Text = component3Cfg.Name;
UpdateOperations3(component3ClassNameComboBox.Text);
}
private void startButton_Click(object sender, EventArgs e)
{
tbfComponents.Clear();
tbfDevices.Clear();
tbfComponent1forOp = null;
operation1 = null;
operation2 = null;
operation3 = null;
operation4 = null;
tbfComponent2forOp = null;
operation21 = null;
operation22 = null;
operation23 = null;
operation24 = null;
tbfComponent3forOp = null;
operation31 = null;
operation32 = null;
operation33 = null;
operation34 = null;
workerThreadRunning = false;
string initializedDeviceName = "none";
try
{
if (parentFactory != null && parentCfg != null)
{
TBF.BenchControl.Generic.IComponent component = parentFactory.GetComponent(parentCfg, tbfComponents);
tbfComponents.Add(component);
if (component is IDevice) tbfDevices.Add(component as IDevice);
IDevice dev = component as IDevice;
if (dev != null)
{
initializedDeviceName = dev.Name;
dev.Initialize();
tbfDevices.Add(dev);
}
}
if (componentFactory != null && componentCfg != null)
if (component1Factory != null && component1Cfg != null)
{
TBF.BenchControl.Generic.IComponent component = componentFactory.GetComponent(componentCfg, tbfComponents);
TBF.BenchControl.Generic.IComponent component = component1Factory.GetComponent(component1Cfg, tbfComponents);
tbfComponents.Add(component);
if (component is IDevice) tbfDevices.Add(component as IDevice);
tbfComponent1forOp = component;
IDevice dev = component as IDevice;
if (dev != null)
{
initializedDeviceName = dev.Name;
dev.Initialize();
tbfDevices.Add(dev);
}
}
if (component2Factory != null && component2Cfg != null)
{
TBF.BenchControl.Generic.IComponent component2 = component2Factory.GetComponent(component2Cfg, tbfComponents);
tbfComponents.Add(component2);
tbfComponent2forOp = component2;
IDevice dev = component2 as IDevice;
if (dev != null)
{
initializedDeviceName = dev.Name;
dev.Initialize();
tbfDevices.Add(dev);
}
}
if (component3Factory != null && component3Cfg != null)
{
TBF.BenchControl.Generic.IComponent component3 = component3Factory.GetComponent(component3Cfg, tbfComponents);
tbfComponents.Add(component3);
tbfComponent3forOp = component3;
IDevice dev = component3 as IDevice;
if (dev != null)
{
initializedDeviceName = dev.Name;
dev.Initialize();
tbfDevices.Add(dev);
}
}
if (tbfComponents.Count == 0) throw new Exception("There are no components");
foreach (var d in tbfDevices) d.Initialize();
SaveSettings(); /// Save settings after successful initialization
workerThread = new Thread(Worker);
workerThread.CurrentCulture = Thread.CurrentThread.CurrentCulture;
workerThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
workerThreadRunning = true;
workerThread.Start();
startButton.Enabled = false;
stopButton.Enabled = true;
configureComponent2Button.Enabled = false;
configureComponent1Button.Enabled = false;
configureParentButton.Enabled = false;
}
catch (Exception exc)
{
MessageBox.Show(string.Format("Exception: {0}", exc.Message), "Initialization failed",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
configureButton.Enabled = true;
workerThreadRunning = false;
workerThread = null;
MessageBox.Show(exc.Message,
string.Format("'{0}' initialization failed", initializedDeviceName),
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
foreach (var dev in tbfDevices) dev.StopDevice();
tbfDevices.Clear();
startButton.Enabled = true;
stopButton.Enabled = false;
configureComponent2Button.Enabled = true;
configureComponent1Button.Enabled = true;
configureParentButton.Enabled = true;
startButton.Enabled = false;
return;
}
configureButton.Enabled = false;
configureParentButton.Enabled = false;
startButton.Enabled = true;
// MessageBox.Show("Hura !", "Initialization successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void startButton_Click(object sender, EventArgs e)
{
startButton.Enabled = false;
stopButton.Enabled = true;
}
private void stopButton_Click(object sender, EventArgs e)
{
startButton.Enabled = true;
stopButton.Enabled = false;
configureButton.Enabled = false;
configureParentButton.Enabled = false;
}
static void Worker()
{
do
int activeOperationLocal = 0;
int previousOperation = 0;
if (tbfComponent1forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
{
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref floatBox);
}
else if (tbfComponent1forOp is TBF.BenchControl.Network.Camera.CLP1611.Camera)
{
operation1 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
operation2 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
}
else if (tbfComponent1forOp is TBF.BenchControl.Network.Camera.Roi.Roi)
{
operation1 = (tbfComponent1forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp();
}
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
{
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation3 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).ReadTemperatureOp();
}
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);
}
if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
{
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref floatBox);
}
else if (tbfComponent2forOp is TBF.BenchControl.Network.Camera.CLP1611.Camera)
{
operation21 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
operation22 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
}
else if (tbfComponent2forOp is TBF.BenchControl.Network.Camera.Roi.Roi)
{
operation21 = (tbfComponent2forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp();
}
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);
operation23 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).ReadTemperatureOp();
}
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);
}
if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter).ReadPressureOp(ref floatBox);
}
else if (tbfComponent3forOp is TBF.BenchControl.Network.Camera.CLP1611.Camera)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(false);
operation33 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.CLP1611.Camera).LiveStreamOp(true);
}
else if (tbfComponent3forOp is TBF.BenchControl.Network.Camera.Roi.Roi)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Network.Camera.Roi.Roi).RoiDetectionOp();
}
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);
operation33 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).ReadTemperatureOp();
}
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);
}
while (workerThreadRunning)
{
Thread.Sleep(1000);
foreach (var d in tbfDevices) d.RunDeviceBefore();
foreach (var d in tbfDevices) d.RunDeviceAfter();
if (workerThreadRunning)
{
foreach (var d in tbfDevices) d.RunDeviceBefore();
if (tbfComponent1forOp != null)
{
previousOperation = activeOperationLocal;
activeOperationLocal = activeOperationId;
if (previousOperation == 0 && activeOperationLocal != 0)
{
switch (activeOperationLocal)
{
case 1: if (operation1 != null) operation1.Start(); Debug.WriteLine("op1.Start()"); break;
case 2: if (operation2 != null) operation2.Start(); Debug.WriteLine("op2.Start()"); break;
case 3: if (operation3 != null) operation3.Start(); Debug.WriteLine("op3.Start()"); break;
case 4: if (operation4 != null) operation4.Start(); Debug.WriteLine("op4.Start()"); break;
case 21: if (operation21 != null) operation21.Start(); Debug.WriteLine("op21.Start()"); break;
case 22: if (operation22 != null) operation22.Start(); Debug.WriteLine("op22.Start()"); break;
case 23: if (operation23 != null) operation23.Start(); Debug.WriteLine("op23.Start()"); break;
case 24: if (operation24 != null) operation24.Start(); Debug.WriteLine("op24.Start()"); break;
case 31: if (operation31 != null) operation31.Start(); Debug.WriteLine("op31.Start()"); break;
case 32: if (operation32 != null) operation32.Start(); Debug.WriteLine("op32.Start()"); break;
case 33: if (operation33 != null) operation33.Start(); Debug.WriteLine("op33.Start()"); break;
case 34: if (operation34 != null) operation34.Start(); Debug.WriteLine("op34.Start()"); break;
}
}
else if (previousOperation == activeOperationLocal && activeOperationLocal != 0)
{
switch (activeOperationLocal)
{
case 1: if (operation1 != null) evnt = operation1.Run(); Debug.WriteLine("op1.Run() -> {0}", evnt); break;
case 2: if (operation2 != null) evnt = operation2.Run(); Debug.WriteLine("op2.Run() -> {0}", evnt); break;
case 3: if (operation3 != null) evnt = operation3.Run(); Debug.WriteLine("op3.Run() -> {0}", evnt); break;
case 4: if (operation4 != null) evnt = operation4.Run(); Debug.WriteLine("op4.Run() -> {0}", evnt); break;
case 21: if (operation21 != null) evnt = operation21.Run(); Debug.WriteLine("op21.Run() -> {0}", evnt); break;
case 22: if (operation22 != null) evnt = operation22.Run(); Debug.WriteLine("op22.Run() -> {0}", evnt); break;
case 23: if (operation23 != null) evnt = operation23.Run(); Debug.WriteLine("op23.Run() -> {0}", evnt); break;
case 24: if (operation24 != null) evnt = operation24.Run(); Debug.WriteLine("op24.Run() -> {0}", evnt); break;
case 31: if (operation31 != null) evnt = operation31.Run(); Debug.WriteLine("op31.Run() -> {0}", evnt); break;
case 32: if (operation32 != null) evnt = operation32.Run(); Debug.WriteLine("op32.Run() -> {0}", evnt); break;
case 33: if (operation33 != null) evnt = operation33.Run(); Debug.WriteLine("op33.Run() -> {0}", evnt); break;
case 34: if (operation34 != null) evnt = operation34.Run(); Debug.WriteLine("op34.Run() -> {0}", evnt); break;
default: evnt = Event.None; break;
}
}
else if (previousOperation != 0 && activeOperationLocal == 0)
{
switch (previousOperation)
{
case 1: if (operation1 != null) operation1.Stop(); Debug.WriteLine("op1.Stop()"); break;
case 2: if (operation2 != null) operation2.Stop(); Debug.WriteLine("op2.Stop()"); break;
case 3: if (operation3 != null) operation3.Stop(); Debug.WriteLine("op3.Stop()"); break;
case 4: if (operation4 != null) operation4.Stop(); Debug.WriteLine("op4.Stop()"); break;
case 21: if (operation21 != null) operation21.Stop(); Debug.WriteLine("op21.Stop()"); break;
case 22: if (operation22 != null) operation22.Stop(); Debug.WriteLine("op22.Stop()"); break;
case 23: if (operation23 != null) operation23.Stop(); Debug.WriteLine("op23.Stop()"); break;
case 24: if (operation24 != null) operation24.Stop(); Debug.WriteLine("op24.Stop()"); break;
case 31: if (operation31 != null) operation31.Stop(); Debug.WriteLine("op31.Stop()"); break;
case 32: if (operation32 != null) operation32.Stop(); Debug.WriteLine("op32.Stop()"); break;
case 33: if (operation33 != null) operation33.Stop(); Debug.WriteLine("op33.Stop()"); break;
case 34: if (operation34 != null) operation34.Stop(); Debug.WriteLine("op34.Stop()"); break;
}
}
}
foreach (var d in tbfDevices) d.RunDeviceAfter();
}
}
while (true);
foreach (var d in tbfDevices) d.StopDevice();
}
private void stopButton_Click(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
workerThreadRunning = false;
workerThread.Join(5000);
workerThread = null;
Cursor = Cursors.Default;
startButton.Enabled = true;
stopButton.Enabled = false;
configureParentButton.Enabled = true;
configureComponent1Button.Enabled = true;
configureComponent2Button.Enabled = true;
configureComponent3Button.Enabled = true;
}
private void DeviceTestDlg_FormClosing(object sender, FormClosingEventArgs e)
{
Cursor = Cursors.WaitCursor;
if (workerThread != null)
{
workerThreadRunning = false;
workerThread.Join(3000);
workerThread = null;
}
Cursor = Cursors.Default;
SaveSettings();
Cursor = Cursors.Default;
}
}
}
+126
View File
@@ -0,0 +1,126 @@
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
namespace DeviceTest
{
/// <summary>
/// Class to be serialized to an XML file...
/// </summary>
[XmlRootAttribute("DeviceTest")]
public class LocalSettings
{
public string ParentClassName;
public string ParentName;
public string ParentSettings;
public string ComponentClassName;
public string ComponentName;
public string ComponentParentName;
public string ComponentSettings;
public string Component2ClassName;
public string Component2Name;
public string Component2ParentName;
public string Component2Settings;
public string Component3ClassName;
public string Component3Name;
public string Component3ParentName;
public string Component3Settings;
public LocalSettings()
{
}
/// <summary>
/// Load public fields of this class from the XML file.
/// </summary>
/// <returns>LocalSettings object or null when Load() fails</returns>
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 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;
}
}
/// <summary>
/// Updates history stored in a string array by a new latest string.
/// </summary>
/// <param name="lastStrValue">Last entered string</param>
/// <returns>true = updated and saved</returns>
public bool UpdateHistory(string lastStrValue, ref string[] history)
{
const int MaxHistoryLen = 10;
if (string.IsNullOrEmpty(lastStrValue)) return false;
int currentHistoryLength = (history != null) ? history.Length : 0;
int match = -1;
for (int i = 0; i < currentHistoryLength; i++)
{
if (history[i] == lastStrValue)
{
match = i;
break;
}
}
if (match >= 0 || currentHistoryLength >= MaxHistoryLen)
{
/// History does not have to be extended (because of a match) or should not be extended (because of the lenght)
if (match < 0) match = currentHistoryLength - 1;
for (int j = match; j > 0; j--)
{
history[j] = history[j - 1];
}
history[0] = lastStrValue;
}
else
{
/// History will be extended, new item inserted at the beginning
string[] newHistory = new string[currentHistoryLength + 1];
newHistory[0] = lastStrValue;
for (int j = 1; j <= currentHistoryLength; j++)
{
newHistory[j] = history[j - 1];
}
history = newHistory;
}
Save();
return true;
}
}
}
+104 -14
View File
@@ -1,21 +1,111 @@
using System;
using System.Collections.Generic;
using System.Linq;
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.IO;
using System.Windows.Forms;
using log4net;
namespace DeviceTest
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new DeviceTestDlg());
}
}
/// Program information
public static string Version; /// version string
public static DateTime BuildDateTime; /// date and time of program build
/// log4net
static ILog log;
const string log4netConfigFName = "log4netConfig.xml";
/// Local settings
public static readonly string LocAppDataDir;
public static readonly string LocalSettingsFileName;
public static readonly string LocalSettingsBackupName;
public static LocalSettings LocalSettings;
static Program()
{
/// Program version string
System.Reflection.Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
Version ver = thisAssembly.GetName().Version;
Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
BuildDateTime = new System.IO.FileInfo(thisAssembly.Location).LastWriteTime;
/// Local program configuration directory including the trailing backslash
LocAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
Path.DirectorySeparatorChar + "TestBenchFramework" + Path.DirectorySeparatorChar;
LocalSettingsFileName = LocAppDataDir + "DeviceTest.xml";
LocalSettingsBackupName = LocAppDataDir + "DeviceTest.backup.xml";
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
///
/// Load the local settings
///
Program.LocalSettings = LocalSettings.Load(Program.LocalSettingsFileName);
if (Program.LocalSettings == null)
{
/// Loading local seetings from regular config file failed. Use the backup
Program.LocalSettings = LocalSettings.Load(Program.LocalSettingsBackupName);
if (Program.LocalSettings == null)
{
MessageBox.Show("Na tomto počítači nebol tento program ani raz spustený.\r\nPoužijú sa základné nastavenia.", "Upozornenie", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
Program.LocalSettings = new LocalSettings();
Directory.CreateDirectory(LocAppDataDir);
Program.LocalSettings.Save();
}
else
{
LocalSettings.Save(); /// Save the settings to overwrite the wrong file
}
}
else
{
/// Loading local seetings from the regular config file was successful. Update the backup
File.Copy(Program.LocalSettingsFileName, Program.LocalSettingsBackupName, true);
}
/// Configure and start logging
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(LocAppDataDir + log4netConfigFName));
log = LogManager.GetLogger(typeof(Program));
log.Fatal("--------------------------------------------------------------------------------");
log.Fatal(string.Format("TBF ver.{0}", Version));
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
DeviceTestDlg dlg = new DeviceTestDlg();
Application.Run(dlg);
}
catch (Exception exc)
{
LogException(log, "Exception in Application.Run(DeviceTestDlg)", exc);
MessageBox.Show("Program havaroval:" +
Environment.NewLine + Environment.NewLine + exc.Message +
((exc.InnerException == null) ? string.Empty : (Environment.NewLine + exc.InnerException.Message)) +
Environment.NewLine + exc.StackTrace,
"Pozor!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
static void LogException(ILog log, string description, Exception e)
{
log.FatalFormat("---------------( {0} )---------------", description);
log.FatalFormat("Message : {0}", e.Message);
if (e.InnerException != null)
{
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
}
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
log.Fatal("--------------------------------------");
}
}
}
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{439D0878-C76E-452B-B17D-209A89E91D36}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dirichlet.Numerics</RootNamespace>
<AssemblyName>Dirichlet.Numerics</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="Int128.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UInt128.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Dirichlet.Numerics")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Dirichlet.Numerics")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a588abc0-c631-4475-9eab-4163d9f81fed")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
Copyright 2014 Rick Sladkey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+1 -1
View File
@@ -49,7 +49,7 @@ namespace Results
ProtocolTitle = procedure.ProtocolTitle,
StartTime = DateTime.Now,
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
#if HEAT_METERS_SUPPORT
#if HEAT_METERS
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter),
#endif
};
+8 -8
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -177,9 +177,9 @@ namespace Results
{
ISession session = DB.CreateSession();
TestDataList = session.CreateQuery("FROM TestData").List<Entities.TestData>();
ComponentsList = session.CreateQuery("FROM Components").List<Entities.Components>();
WaterMeterDataList = session.CreateQuery("FROM WaterMeterData").List<Entities.WaterMeterData>();
TestDataList = session.QueryOver<TestData>().List();
ComponentsList = session.QueryOver<Components>().List();
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
}
/// <summary>
@@ -189,7 +189,7 @@ namespace Results
public static int GetMaxSavedBatchNr()
{
ISession session = DB.CreateSession();
IList<Entities.Batch> batches = session.CreateQuery("FROM Batch").List<Entities.Batch>();
IList<Entities.Batch> batches = session.QueryOver<Batch>().List();
int maxBatchNr = 0;
foreach (var b in batches)
@@ -239,9 +239,9 @@ namespace Results
ISession session = DB.CreateSession();
if (session == null) return false;
TestDataList = session.CreateQuery("FROM TestData").List<Entities.TestData>();
ComponentsList = session.CreateQuery("FROM Components").List<Entities.Components>();
WaterMeterDataList = session.CreateQuery("FROM WaterMeterData").List<Entities.WaterMeterData>();
TestDataList = session.QueryOver<TestData>().List();
ComponentsList = session.QueryOver<Components>().List();
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
UpdateBatchData(batch);
+3 -3
View File
@@ -44,7 +44,7 @@ namespace Results.Entities
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbientTempAve;
foreach (var tr in TestRslts) sum += tr.AmbTempMean;
return sum / TestRslts.Count;
}
@@ -52,7 +52,7 @@ namespace Results.Entities
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbientPressAve;
foreach (var tr in TestRslts) sum += tr.AmbPressMean;
return sum / TestRslts.Count;
}
@@ -60,7 +60,7 @@ namespace Results.Entities
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbientHumiAve;
foreach (var tr in TestRslts) sum += tr.AmbHumiMean;
return sum / TestRslts.Count;
}
+34 -27
View File
@@ -41,59 +41,66 @@ namespace Results.Entities
public virtual double RefEnergy { get; set; } /// [J] Joul
/// Auxiliary results
public virtual float AmbientTempAve { get; set; } /// [°C] Average ambient air temperature
public virtual float AmbTempMean { get; set; } /// [°C] Average ambient air temperature
public virtual float AmbTempStart { get; set; } /// [°C] Ambient air temperature on test start
public virtual float AmbTempEnd { get; set; } /// [°C] Ambient air temperature on test end
public virtual float AmbTempMin { get; set; } /// [°C] Minimum ambient air temperature
public virtual float AmbTempMax { get; set; } /// [°C] Maximum ambient air temperature
public virtual float AmbientPressAve { get; set; } /// [bar] Average ambient air pressure
public virtual float AmbPressMean { get; set; } /// [bar] Average ambient air pressure
public virtual float AmbPressStart { get; set; } /// [bar] Ambient air pressure on test start
public virtual float AmbPressEnd { get; set; } /// [bar] Ambient air pressure on test end
public virtual float AmbPressMin { get; set; } /// [bar] Minimum ambient air pressure
public virtual float AmbPressMax { get; set; } /// [bar] Maximum ambient air pressure
public virtual float AmbientHumiAve { get; set; } /// [%] Average ambient air relative humidity
public virtual float AmbHumiMean { get; set; } /// [%] Average ambient air relative humidity
public virtual float AmbHumiStart { get; set; } /// [%] Ambient air relative humidity on test start
public virtual float AmbHumiEnd { get; set; } /// [%] Ambient air relative humidity on test end
public virtual float AmbHumiMin { get; set; } /// [%] Minimum ambient air relative humidity
public virtual float AmbHumiMax { get; set; } /// [%] Maximum ambient air relative humidity
public virtual float PressUpAvrg { get; set; } /// [bar] Input water pressure (average)
public virtual float PressUpMean { get; set; } /// [bar] Input water pressure (average)
public virtual float PressUpStart { get; set; } /// [bar]
public virtual float PressUpEnd { get; set; } /// [bar]
public virtual float PressUpMin { get; set; } /// [bar]
public virtual float PressUpMax { get; set; } /// [bar]
public virtual float PressDownAvrg { get; set; } /// [bar]
public virtual float PressDownMean { get; set; } /// [bar]
public virtual float PressDownStart { get; set; } /// [bar]
public virtual float PressDownEnd { get; set; } /// [bar]
public virtual float PressDownMin { get; set; } /// [bar]
public virtual float PressDownMax { get; set; } /// [bar]
public virtual float TempInAvrg { get; set; } /// [°C]
public virtual float TempInStart { get; set; } /// [°C]
public virtual float TempInEnd { get; set; } /// [°C]
public virtual float TempInMin { get; set; } /// [°C]
public virtual float TempInMax { get; set; } /// [°C]
public virtual float TempOutAvrg { get; set; } /// [°C]
public virtual float TempOutStart { get; set; } /// [°C]
public virtual float TempOutEnd { get; set; } /// [°C]
public virtual float TempOutMin { get; set; } /// [°C]
public virtual float TempOutMax { get; set; } /// [°C]
public virtual float TempDivAvrg { get; set; } /// [°C]
public virtual float PressDeltaMean { get; set; } /// [bar]
public virtual float PressDeltaStart { get; set; } /// [bar]
public virtual float PressDeltaEnd { get; set; } /// [bar]
public virtual float PressDeltaMin { get; set; } /// [bar]
public virtual float PressDeltaMax { get; set; } /// [bar]
public virtual float TempUpMean { get; set; } /// [°C]
public virtual float TempUpStart { get; set; } /// [°C]
public virtual float TempUpEnd { get; set; } /// [°C]
public virtual float TempUpMin { get; set; } /// [°C]
public virtual float TempUpMax { get; set; } /// [°C]
public virtual float TempDownMean { get; set; } /// [°C]
public virtual float TempDownStart { get; set; } /// [°C]
public virtual float TempDownEnd { get; set; } /// [°C]
public virtual float TempDownMin { get; set; } /// [°C]
public virtual float TempDownMax { get; set; } /// [°C]
public virtual float TempDivMean { get; set; } /// [°C]
public virtual float TempDivStart { get; set; } /// [°C]
public virtual float TempDivEnd { get; set; } /// [°C]
public virtual float TempDivMin { get; set; } /// [°C]
public virtual float TempDivMax { get; set; } /// [°C]
public virtual float FlowMin { get; set; } /// [m3/h] minimum flow
public virtual float FlowStart { get; set; } /// [m3/h] minimum flow
public virtual float FlowEnd { get; set; } /// [m3/h] maximum flow
public virtual float FlowMin { get; set; } /// [m3/h] minimum flow
public virtual float FlowMax { get; set; } /// [m3/h] maximum flow
public virtual float Custom1 { get; set; } /// [°C] T ref warm mean
public virtual float Custom2 { get; set; } /// [°C] T ref warm start
public virtual float Custom3 { get; set; } /// [°C] T ref warm end
public virtual float Custom4 { get; set; } /// [°C] T ref warm min
public virtual float Custom5 { get; set; } /// [°C] T ref warm max
public virtual float Custom6 { get; set; } /// [°C] T ref cold mean
public virtual float Custom7 { get; set; } /// [°C] T ref cold start
public virtual float Custom8 { get; set; } /// [°C] T ref cold end
public virtual float Custom9 { get; set; } /// [°C] T ref cold min
public virtual float Custom10 { get; set; } /// [°C] T ref cold max
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
public virtual float Custom3 { get; set; } /// [°C] T ref hi end
public virtual float Custom4 { get; set; } /// [°C] T ref hi min
public virtual float Custom5 { get; set; } /// [°C] T ref hi max
public virtual float Custom6 { get; set; } /// [°C] T ref lo mean
public virtual float Custom7 { get; set; } /// [°C] T ref lo start
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
/// Wrappers
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
+20 -7
View File
@@ -21,7 +21,7 @@ namespace Results.Entities
public virtual bool Passed { get; set; }
public virtual int ResultCode { get; set; }
#if IPERLST || IPERLST_SPECIAL
#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
@@ -35,7 +35,7 @@ namespace Results.Entities
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 !!!
#endif
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual Batch Batch { get; set; }
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
@@ -92,7 +92,7 @@ namespace Results.Entities
public virtual MeterTestRslt GetMeterTestRslt(string testName)
{
return GetMeterTestRslt(testName, CompoundMeterId.Single);
return GetMeterTestRslt(testName, CompoundMeterId.SingleOrCompound);
}
public virtual MeterTestRslt GetMeterTestRslt(string testName, Config.Entities.CompoundMeterId meterId)
@@ -101,9 +101,22 @@ namespace Results.Entities
string testNameL = testName.ToLower();
foreach (var mtr in MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)meterId) && mtr.Name().ToLower().Equals(testNameL))
if (mtr.Name().ToLower().Equals(testNameL))
{
return mtr;
if (mtr.CompoundMeterId == (byte)meterId)
{
return mtr;
}
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound &&
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Single)
{
return mtr;
}
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound &&
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Compound)
{
return mtr;
}
}
}
return null;
@@ -130,10 +143,10 @@ namespace Results.Entities
public override string ToString()
{
StringBuilder sb = new StringBuilder(80);
#if IPERLST || IPERLST_SPECIAL
#if IPERL
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrEx);
#else
sb.AppendFormat("S/N:{0} ", SerialNr);
sb.AppendFormat("S/N:{0} ", SerialNr);
#endif
foreach (var tr in MeterTestRslts) sb.AppendFormat(" {0}:{1}%", tr.Name(), tr.Error.ToString("F2"));
+4 -4
View File
@@ -49,12 +49,12 @@ namespace Results.Entities
public virtual bool Compound { get; set; }
public virtual bool HeatMeter { get; set; }
#if IPERLST || IPERLST_SPECIAL
#if IPERL
public virtual int WMTypeId { get; set; }
public virtual int WMTypeRev { get; set; }
#endif
public WaterMeterData()
public WaterMeterData()
{
}
@@ -103,11 +103,11 @@ namespace Results.Entities
if (Compound != wmd.Compound) return false;
if (HeatMeter != wmd.HeatMeter) return false;
#if IPERLST || IPERLST_SPECIAL
#if IPERL
if (WMTypeId != wmd.WMTypeId) return false;
if (WMTypeRev != wmd.WMTypeRev) return false;
#endif
return true;
return true;
}
+240 -80
View File
@@ -3,6 +3,7 @@
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using log4net;
using Config.Entities;
@@ -20,33 +21,50 @@ namespace Results.Forms
{
Item,
Caption,
TestID,
Units,
Format,
Precision,
Width,
Alignment,
Count,
TestID,
Count,
}
Control[] editors;
Control[] editors; /// all editors except of units
ComboBox unitsCB; /// units combo box
public IList<WMeterRsltItemSpec> AvailableItems;
public IList<WMeterRsltItemSpec> SelectedItems;
public MetersKind MetersKind;
bool supressTestIDColumn;
public ResultsConfigDlg(bool supressTestIDColumn)
: this()
{
this.supressTestIDColumn = supressTestIDColumn;
}
public ResultsConfigDlg()
{
InitializeComponent();
}
void Localize()
{
Text = Strings.Configuration;
availableResultsLabel.Text = Strings.Available_results;
availableTabControl.TabPages[0].Text = "A...Z";
availableTabControl.TabPages[1].Text = Strings.Quantity;
availableTabControl.TabPages[2].Text = Strings.Category;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
@@ -63,37 +81,35 @@ namespace Results.Forms
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Units });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Alignment });
if (!supressTestIDColumn)
{
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Test_ID });
}
/// Create controls used by ListViewEx to edit items
ComboBox unitsCB = new ComboBox();
unitsCB.Items.Add("---"); /// Use "---" instead of "None"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
unitsCB.Items.Add(u.ToString().Replace("Pct", "%").Replace('p', '/'));
}
unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
alignmentCB.Items.Add(a.ToString());
alignmentCB.Items.Add(a.ToDescription());
}
editors = new Control[]
{
null,
new TextBox(),
new TextBox(),
new TextBox(), /// caption
unitsCB,
new TextBox(),
new TextBox(),
new TextBox(),
new TextBox(), /// format
new TextBox(), /// precision
new TextBox(), /// width
alignmentCB,
new TextBox(), /// testID
};
foreach (var edi in editors)
{
@@ -107,13 +123,28 @@ namespace Results.Forms
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
//availableAlphabeticTreeView.ShowNodeToolTips = true;
//availableByQuantityTreeView.ShowNodeToolTips = true;
//availableByCategoryTreeView.ShowNodeToolTips = true;
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if ((e.SubItem > 0) && (e.SubItem < (int)Column.Count))
if (e.SubItem == (int)Column.Units)
{
Config.Quantity quantity = (e.Item.Tag as WMeterRsltItemSpec).Quantity;
unitsCB.Items.Clear();
unitsCB.Items.Add(Config.Unit.None.ToDescription()); /// "---"
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
{
if (Config.Units.IsQuantity(u, quantity)) unitsCB.Items.Add(u.ToDescription());
}
selectedResultsListViewEx.StartEditing(unitsCB, e.Item, e.SubItem);
}
else if ((e.SubItem > 0) && (e.SubItem < (int)(supressTestIDColumn ? Column.TestID : Column.Count)))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
@@ -127,15 +158,10 @@ namespace Results.Forms
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
case Column.TestID: item.TestID = e.DisplayText; return;
case Column.Format: item.Format = e.DisplayText; return;
case Column.Precision: item.Precision = e.DisplayText; return;
case Column.Units:
if (editors[e.SubItem].Text == "---") { item.Units = 0; return; };
for (Config.Unit u = (Config.Unit)1; u < Config.Unit.Count; u++)
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToString().Replace("Pct", "%").Replace('p', '/').Equals(editors[e.SubItem].Text))
if (u.ToDescription().Equals(unitsCB.Text))
{
item.Units = u;
return; /// OK
@@ -143,28 +169,33 @@ namespace Results.Forms
}
break; /// Error
case Column.Format: item.Format = e.DisplayText; return;
case Column.Precision: item.Precision = e.DisplayText; return;
case Column.Width:
{
int width;
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
{
item.Width = width;
return; /// OK
}
break; /// Error
}
case Column.Alignment:
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
if (a.ToString().Equals(editors[e.SubItem].Text))
if (a.ToDescription().Equals(editors[e.SubItem].Text))
{
item.Alignment = a;
return;
}
}
break; /// Error
case Column.Width:
{
int width;
if (Int32.TryParse(editors[e.SubItem].Text, out width) && width >= 0)
{
item.Width = width;
return; /// OK
}
break; /// Error
}
default:
case Column.TestID: item.TestID = e.DisplayText; return;
default:
return; /// OK
}
@@ -173,20 +204,110 @@ namespace Results.Forms
return;
}
/// <summary>
/// Redraw selected items (right hand side)
/// Redraw available items (right hand side)
/// </summary>
void RedrawAvailable()
{
availableResultsListBox.Items.Clear();
AvailableItems = new List<WMeterRsltItemSpec>();
foreach (var item in WMeterRsltItemSpec.AllItems)
RedrawInAlphabeticOrder(availableAlphabeticTreeView);
RedrawByQuantity(availableByQuantityTreeView);
RedrawByCategory(availableByCategoryTreeView);
}
void RedrawInAlphabeticOrder(TreeView treeView)
{
treeView.Nodes.Clear();
IList<WMeterRsltItemSpec> alphabeticlList = WMeterRsltItemSpec.AllItems.OrderBy(x => x.Name).ToList();
///
foreach (var item in alphabeticlList)
{
AvailableItems.Add(item);
availableResultsListBox.Items.Add(item.Name);
TreeNode node = new TreeNode(item.Name);
node.Tag = item;
node.ToolTipText = item.ToolTipText;
availableAlphabeticTreeView.Nodes.Add(node);
}
}
void RedrawByQuantity(TreeView treeView)
{
treeView.Nodes.Clear();
IList<Config.Quantity> quantities = new List<Config.Quantity>();
for (Config.Quantity q = 0; q < Config.Quantity.Count; q++) quantities.Add(q);
IList<Config.Quantity> sortedQuantities = quantities.OrderBy(x => x.ToDescription()).ToList();
foreach (var q in sortedQuantities)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Quantity == q)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(q.ToDescription(), array));
}
}
}
void RedrawByCategory(TreeView treeView)
{
treeView.Nodes.Clear();
IList<ItemCategory> categories = new List<ItemCategory>();
for (ItemCategory c = 0; c < ItemCategory.Count; c++) categories.Add(c);
IList<ItemCategory> sortedCategories = categories.OrderBy(x => x.ToDescription()).ToList();
foreach (var c in sortedCategories)
{
int n = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c) n++;
}
if (n > 0)
{
TreeNode[] array = new TreeNode[n];
int i = 0;
foreach (var ri in WMeterRsltItemSpec.AllItems)
{
if (ri.Category == c)
{
TreeNode node = new TreeNode(ri.Name);
node.Tag = ri;
node.ToolTipText = ri.ToolTipText;
array[i++] = node;
}
}
treeView.Nodes.Add(new TreeNode(c.ToDescription(), array));
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
@@ -195,15 +316,18 @@ namespace Results.Forms
selectedResultsListViewEx.Items.Clear();
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.TestID); /// TestID
lvi.SubItems.Add((item.Units == Config.Unit.None) ? "---" : item.Units.ToString().Replace("Pct", "%").Replace('p', '/')); /// Units
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
lvi.SubItems.Add(item.Alignment.ToString()); /// Alignment
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Units.ToDescription()); /// Units
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
lvi.SubItems.Add(item.Alignment.ToDescription()); /// Alignment
if (!supressTestIDColumn)
{
lvi.SubItems.Add(item.TestID); /// TestID
}
selectedResultsListViewEx.Items.Add(lvi);
}
@@ -213,41 +337,65 @@ namespace Results.Forms
{
}
void availableResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (availableResultsListBox.SelectedIndices.Count == 1)
{
var oriItem = AvailableItems[availableResultsListBox.SelectedIndices[0]];
SelectedItems.Add(oriItem.Clone());
RedrawAvailable();
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
}
void addButton_Click(object sender, EventArgs e)
{
/// Append at the end, this code supports multiple selected items,
/// although ListBox control settings may limit the max.number of selected items to one.
for (int i = availableResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
switch (availableTabControl.SelectedIndex)
{
var oriItem = AvailableItems[availableResultsListBox.SelectedIndices[i]];
SelectedItems.Add(oriItem.Clone());
case 0:
availableAlphabeticTreeView_DoubleClick(this, null);
break;
case 1:
availableByQuantityTreeView_DoubleClick(this, null);
break;
case 2:
availableByCategoryTreeView_DoubleClick(this, null);
break;
default:
break;
}
RedrawAvailable();
}
private void availableAlphabeticTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableAlphabeticTreeView.SelectedNode != null &&
availableAlphabeticTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableAlphabeticTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByQuantityTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByQuantityTreeView.SelectedNode != null &&
availableByQuantityTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByQuantityTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
private void availableByCategoryTreeView_DoubleClick(object sender, EventArgs e)
{
if (availableByCategoryTreeView.SelectedNode != null &&
availableByCategoryTreeView.SelectedNode.Tag is WMeterRsltItemSpec)
{
AddItem(availableByCategoryTreeView.SelectedNode.Tag as WMeterRsltItemSpec);
}
}
void AddItem(WMeterRsltItemSpec item)
{
WMeterRsltItemSpec newItem = item.Clone();
newItem.Caption = newItem.Name;
SelectedItems.Add(newItem);
RedrawSelected();
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
/// Select the last item
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
selectedResultsListViewEx.Items[SelectedItems.Count - 1].EnsureVisible();
}
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
{
@@ -346,5 +494,17 @@ namespace Results.Forms
DialogResult = DialogResult.Cancel;
Close();
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
private void availableByCategoryTreeView_NodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.SetToolTip(this, e.Node.ToolTipText);
}
}
}
+239 -151
View File
@@ -31,156 +31,238 @@ namespace Results.Forms
/// </summary>
private void InitializeComponent()
{
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.availableResultsListBox = new System.Windows.Forms.ListBox();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.upButton = new System.Windows.Forms.Button();
this.downButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(344, 401);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(104, 30);
this.okButton.TabIndex = 4;
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(465, 401);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// availableResultsListBox
//
this.availableResultsListBox.FormattingEnabled = true;
this.availableResultsListBox.Location = new System.Drawing.Point(12, 31);
this.availableResultsListBox.Name = "availableResultsListBox";
this.availableResultsListBox.Size = new System.Drawing.Size(162, 355);
this.availableResultsListBox.TabIndex = 6;
this.availableResultsListBox.DoubleClick += new System.EventHandler(this.availableResultsListBox_DoubleClick);
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(12, 9);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 8;
this.availableResultsLabel.Text = "Available results:";
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(284, 9);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 9;
this.selectedResultsLabel.Text = "Selected results:";
//
// removeAllButton
//
this.removeAllButton.Location = new System.Drawing.Point(184, 144);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 46;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Location = new System.Drawing.Point(184, 109);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 45;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Location = new System.Drawing.Point(184, 74);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 44;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(287, 31);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 355);
this.selectedResultsListViewEx.TabIndex = 47;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(this.selectedResultsListViewEx_SubItemClicked);
this.selectedResultsListViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(this.selectedResultsListViewEx_SubItemEndEditing);
//
// upButton
//
this.upButton.Location = new System.Drawing.Point(184, 236);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 48;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// downButton
//
this.downButton.Location = new System.Drawing.Point(184, 272);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 49;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// ResultsConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(893, 445);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Controls.Add(this.availableResultsListBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ResultsConfigDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigDlg_KeyPress);
this.ResumeLayout(false);
this.PerformLayout();
this.components = new System.ComponentModel.Container();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.downButton = new System.Windows.Forms.Button();
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(373, 499);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(105, 30);
this.okButton.TabIndex = 4;
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(494, 499);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(105, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(12, 9);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 8;
this.availableResultsLabel.Text = "Available results:";
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(284, 9);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 9;
this.selectedResultsLabel.Text = "Selected results:";
//
// removeAllButton
//
this.removeAllButton.Location = new System.Drawing.Point(218, 221);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 46;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Location = new System.Drawing.Point(218, 186);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 45;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Location = new System.Drawing.Point(218, 151);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 44;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// upButton
//
this.upButton.Location = new System.Drawing.Point(218, 313);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 48;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// downButton
//
this.downButton.Location = new System.Drawing.Point(218, 349);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 49;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Location = new System.Drawing.Point(6, 31);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 50;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableAlphabeticTreeView);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
//
// availableAlphabeticTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(3, 3);
this.availableAlphabeticTreeView.Name = "availableAlphabeticTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(192, 421);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByQuantityTreeView);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableByQuantityTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableByCategoryTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(0, 0);
this.availableByCategoryTreeView.Name = "availableByCategoryTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(198, 427);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.NodeMouseHover += new System.Windows.Forms.TreeNodeMouseHoverEventHandler(this.availableByCategoryTreeView_NodeMouseHover);
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(317, 31);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 47;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(this.selectedResultsListViewEx_SubItemClicked);
this.selectedResultsListViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(this.selectedResultsListViewEx_SubItemEndEditing);
//
// ResultsConfigDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(923, 543);
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ResultsConfigDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigDlg_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -188,7 +270,6 @@ namespace Results.Forms
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.ListBox availableResultsListBox;
private System.Windows.Forms.Label availableResultsLabel;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Button removeAllButton;
@@ -197,5 +278,12 @@ namespace Results.Forms
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button upButton;
private System.Windows.Forms.Button downButton;
private System.Windows.Forms.TabControl availableTabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TreeView availableAlphabeticTreeView;
private System.Windows.Forms.TreeView availableByQuantityTreeView;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TreeView availableByCategoryTreeView;
}
}
+3
View File
@@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
+27 -4
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
namespace Results
{
@@ -20,8 +23,8 @@ namespace Results
Test_end_time, /// 13
Test_time, /// 14
Flow, /// 15
T_in, /// 16
T_out, /// 17
T_up_mean, /// 16
T_down_mean, /// 17
T_div, /// 18
P_up, /// 19
P_up_start, /// 20
@@ -88,7 +91,27 @@ namespace Results
TempLoStart, /// 81
TempLoEnd, /// 82
TempLoAve, /// 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
Count,
}
}
+23 -9
View File
@@ -114,21 +114,26 @@ namespace Results
AllItems.Add(new ItemSpec("Test end time", Strings.T_end, x => x.EndTime().ToShortTimeString(), (x, y, z) => z.EndTime().ToShortTimeString(), (x, z) => z.EndTime().ToShortTimeString()));
AllItems.Add(new ItemSpec("Test time", Strings.T_s, x => x.TestTime.ToString("F2"), (x, y, z) => z.TestTime.ToString("F2"), (x, z) => z.TestTime.ToString("F2")));
AllItems.Add(new ItemSpec("Flow", Strings.Flow + " [m3/h]", x => Utils.DoubleToStr(x.FlowVolume(), 4), (x, y, z) => Utils.DoubleToStr(z.FlowVolume(), 4), (x, z) => Utils.DoubleToStr(x.FlowVolume(), 4)));
AllItems.Add(new ItemSpec("T in", Strings.T_in + " [°C]", x => x.TestRslt.TempInAvrg.ToString("F2"), (x, y, z) => z.TestRslt.TempInAvrg.ToString("F2"), (x, z) => z.TestRslt.TempInAvrg.ToString("F2")));
AllItems.Add(new ItemSpec("T out", Strings.T_out + " [°C]", x => x.TestRslt.TempOutAvrg.ToString("F2"), (x, y, z) => z.TestRslt.TempOutAvrg.ToString("F2"), (x, z) => z.TestRslt.TempOutAvrg.ToString("F2")));
AllItems.Add(new ItemSpec("T div", Strings.T_div + " [°C]", x => x.TestRslt.TempDivAvrg.ToString("F2"), (x, y, z) => z.TestRslt.TempDivAvrg.ToString("F2"), (x, z) => z.TestRslt.TempDivAvrg.ToString("F2")));
AllItems.Add(new ItemSpec("P up", Strings.P_up + " [kPa]", x => (100 * x.TestRslt.PressUpAvrg).ToString("F3"), (x, y, z) => z.TestRslt.PressUpAvrg.ToString("F3"), (x, z) => z.TestRslt.PressUpAvrg.ToString("F3")));
AllItems.Add(new ItemSpec("T in", Strings.T_in + " [°C]", x => x.TestRslt.TempUpMean.ToString("F2"), (x, y, z) => z.TestRslt.TempUpMean.ToString("F2"), (x, z) => z.TestRslt.TempUpMean.ToString("F2")));
AllItems.Add(new ItemSpec("T out", Strings.T_out + " [°C]", x => x.TestRslt.TempDownMean.ToString("F2"), (x, y, z) => z.TestRslt.TempDownMean.ToString("F2"), (x, z) => z.TestRslt.TempDownMean.ToString("F2")));
AllItems.Add(new ItemSpec("T div", Strings.T_div + " [°C]", x => x.TestRslt.TempDivMean.ToString("F2"), (x, y, z) => z.TestRslt.TempDivMean.ToString("F2"), (x, z) => z.TestRslt.TempDivMean.ToString("F2")));
AllItems.Add(new ItemSpec("P up", Strings.P_up + " [kPa]", x => (100 * x.TestRslt.PressUpMean).ToString("F3"), (x, y, z) => z.TestRslt.PressUpMean.ToString("F3"), (x, z) => z.TestRslt.PressUpMean.ToString("F3")));
AllItems.Add(new ItemSpec("P up start", Strings.P_up_start + " [kPa]", x => (100 * x.TestRslt.PressUpStart).ToString("F3"), (x, y, z) => z.TestRslt.PressUpStart.ToString("F3"), (x, z) => z.TestRslt.PressUpStart.ToString("F3")));
AllItems.Add(new ItemSpec("P up end", Strings.P_up_end + " [kPa]", x => (100 * x.TestRslt.PressUpEnd).ToString("F3"), (x, y, z) => z.TestRslt.PressUpEnd.ToString("F3"), (x, z) => z.TestRslt.PressUpEnd.ToString("F3")));
AllItems.Add(new ItemSpec("P down", Strings.P_dn + " [kPa]", x => (100 * x.TestRslt.PressDownAvrg).ToString("F3"), (x, y, z) => z.TestRslt.PressDownAvrg.ToString("F3"), (x, z) => z.TestRslt.PressDownAvrg.ToString("F3")));
AllItems.Add(new ItemSpec("P down", Strings.P_dn + " [kPa]", x => (100 * x.TestRslt.PressDownMean).ToString("F3"), (x, y, z) => z.TestRslt.PressDownMean.ToString("F3"), (x, z) => z.TestRslt.PressDownMean.ToString("F3")));
AllItems.Add(new ItemSpec("P down start", Strings.P_dn_start + " [kPa]", x => (100 * x.TestRslt.PressDownStart).ToString("F3"), (x, y, z) => z.TestRslt.PressDownStart.ToString("F3"), (x, z) => z.TestRslt.PressDownStart.ToString("F3")));
AllItems.Add(new ItemSpec("P down end", Strings.P_dn_end + " [kPa]", x => (100 * x.TestRslt.PressDownEnd).ToString("F3"), (x, y, z) => z.TestRslt.PressDownEnd.ToString("F3"), (x, z) => z.TestRslt.PressDownEnd.ToString("F3")));
AllItems.Add(new ItemSpec("P delta", Strings.P_delta + " [kPa]", x => (100 * x.TestRslt.PressDeltaMean).ToString("F3"), (x, y, z) => z.TestRslt.PressDeltaMean.ToString("F3"), (x, z) => z.TestRslt.PressDeltaMean.ToString("F3")));
AllItems.Add(new ItemSpec("P delta start", Strings.P_delta_start + " [kPa]", x => (100 * x.TestRslt.PressDeltaStart).ToString("F3"), (x, y, z) => z.TestRslt.PressDeltaStart.ToString("F3"), (x, z) => z.TestRslt.PressDeltaStart.ToString("F3")));
AllItems.Add(new ItemSpec("P delta end", Strings.P_delta_end + " [kPa]", x => (100 * x.TestRslt.PressDeltaEnd).ToString("F3"), (x, y, z) => z.TestRslt.PressDeltaEnd.ToString("F3"), (x, z) => z.TestRslt.PressDeltaEnd.ToString("F3")));
AllItems.Add(new ItemSpec("Reference error", Strings.ErrRef + " [%]", x => x.TestRslt.ErrorMaster.ToString("F3"), (x, y, z) => z.TestRslt.ErrorMaster.ToString("F3"), (x, z) => z.TestRslt.ErrorMaster.ToString("F3")));
AllItems.Add(new ItemSpec("Ambient temperature", Strings.T_amb + " [°C]", x => x.TestRslt.AmbientTempAve.ToString("F1"), (x, y, z) => z.TestRslt.AmbientTempAve.ToString("F1"), (x, z) => z.TestRslt.AmbientTempAve.ToString("F1")));
AllItems.Add(new ItemSpec("Ambient pressure", Strings.P_amb + " [mbar]", x => (1000 * x.TestRslt.AmbientPressAve).ToString("F0"), (x, y, z) => (1000 * z.TestRslt.AmbientPressAve).ToString("F0"), (x, z) => (1000 * z.TestRslt.AmbientPressAve).ToString("F0")));
AllItems.Add(new ItemSpec("Ambient humidity", Strings.H_amb + " [%]", x => x.TestRslt.AmbientHumiAve.ToString("F1"), (x, y, z) => z.TestRslt.AmbientHumiAve.ToString("F1"), (x, z) => z.TestRslt.AmbientHumiAve.ToString("F1")));
AllItems.Add(new ItemSpec("Ambient temperature", Strings.T_amb + " [°C]", x => x.TestRslt.AmbTempMean.ToString("F1"), (x, y, z) => z.TestRslt.AmbTempMean.ToString("F1"), (x, z) => z.TestRslt.AmbTempMean.ToString("F1")));
AllItems.Add(new ItemSpec("Ambient pressure", Strings.P_amb + " [mbar]", x => (1000 * x.TestRslt.AmbPressMean).ToString("F0"), (x, y, z) => (1000 * z.TestRslt.AmbPressMean).ToString("F0"), (x, z) => (1000 * z.TestRslt.AmbPressMean).ToString("F0")));
AllItems.Add(new ItemSpec("Ambient humidity", Strings.H_amb + " [%]", x => x.TestRslt.AmbHumiMean.ToString("F1"), (x, y, z) => z.TestRslt.AmbHumiMean.ToString("F1"), (x, z) => z.TestRslt.AmbHumiMean.ToString("F1")));
/// Single and combined meter results
AllItems.Add(new ItemSpec("Start volume", Strings.Start_volume + " [l]", x => x.VolumeStart.ToString("F3"), (x, y, z) => z.VolumeStart.ToString("F3"), (x, z) => z.VolumeStart.ToString("F3")));
AllItems.Add(new ItemSpec("End volume", Strings.End_volume + " [l]", x => x.VolumeEnd.ToString("F3"), (x, y, z) => z.VolumeEnd.ToString("F3"), (x, z) => z.VolumeEnd.ToString("F3")));
AllItems.Add(new ItemSpec("Volume", Strings.Volume + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => z.VolumeMeter.ToString("F3"), (x, z) => x.VolumeMeter.ToString("F3")));
AllItems.Add(new ItemSpec("Reference volume", Strings.VolRef + " [l]", x => x.VolumeRef.ToString("F3"), (x, y, z) => z.VolumeRef.ToString("F3"), (x, z) => x.VolumeRef.ToString("F3")));
AllItems.Add(new ItemSpec("Error", Strings.Error + " [%]", x => x.Error.ToString("F2"), (x, y, z) => z.Error.ToString("F2"), null));
@@ -173,6 +178,12 @@ namespace Results
AllItems.Add(new ItemSpec("Serial Nr small WM", Strings.sn_aux, null, (x, y, z) => y.SerialNr(), null));
AllItems.Add(new ItemSpec("End state large WM", Strings.EndState_main, null, (x, y, z) => x.EndState(), null));
AllItems.Add(new ItemSpec("End state small WM", Strings.EndState_aux, null, (x, y, z) => y.EndState(), null));
AllItems.Add(new ItemSpec("Start volume main", Strings.Start_volume_main + " [l]",x => x.VolumeMeter.ToString("F3"), (x, y, z) => x.VolumeStart.ToString("F3"), null));
AllItems.Add(new ItemSpec("End volume main", Strings.End_volume_main + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => x.VolumeEnd.ToString("F3"), null));
AllItems.Add(new ItemSpec("Volume main", Strings.Volume_main + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => x.VolumeMeter.ToString("F3"), null));
AllItems.Add(new ItemSpec("Start volume aux", Strings.Start_volume_aux + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => y.VolumeStart.ToString("F3"), null));
AllItems.Add(new ItemSpec("End volume aux", Strings.End_volume_aux + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => y.VolumeEnd.ToString("F3"), null));
AllItems.Add(new ItemSpec("Volume aux", Strings.Volume_aux + " [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => y.VolumeMeter.ToString("F3"), null));
/// Batch info
AllItems.Add(new ItemSpec("Batch number", Strings.Batch_nr, x => x.Batch().BatchNr.ToString(), (x, y, z) => x.Batch().BatchNr.ToString(), (x, z) => x.Batch().BatchNr.ToString()));
@@ -197,7 +208,10 @@ namespace Results
AllItems.Add(new ItemSpec("Temp lo st", "T lo st", null, null, (x, z) => z.TestRslt.Custom7.ToString("F3")));
AllItems.Add(new ItemSpec("Temp lo en", "T lo en", null, null, (x, z) => z.TestRslt.Custom8.ToString("F3")));
AllItems.Add(new ItemSpec("Temp lo av", "T lo av", null, null, (x, z) => ((z.TestRslt.Custom7 + z.TestRslt.Custom8) / 2).ToString("F3")));
}
AllItems.Add(new ItemSpec("Start mass", Strings.Start_mass + " [kg]", x => x.TestRslt.MassStart.ToString("F4"), (x, y, z) => z.TestRslt.MassStart.ToString("F4"), (x, z) => z.TestRslt.MassStart.ToString("F4")));
AllItems.Add(new ItemSpec("End mass", Strings.End_mass + " [kg]", x => x.TestRslt.MassEnd.ToString("F4"), (x, y, z) => z.TestRslt.MassEnd.ToString("F4"), (x, z) => z.TestRslt.MassEnd.ToString("F4")));
}
public static ItemSpec GetItem(string name)
{
+24 -17
View File
@@ -36,49 +36,56 @@ namespace Results.Mappings
Map(x => x.VolumeCTV);
Map(x => x.VolumeMaster);
Map(x => x.ErrorMaster);
#if HEAT_METERS_SUPPORT
#if HEAT_METERS
Map(x => x.RefEnergy);
#endif
Map(x => x.AmbientTempAve);
Map(x => x.AmbTempMean).Column("AmbientTempAve");
Map(x => x.AmbTempStart);
Map(x => x.AmbTempEnd);
Map(x => x.AmbTempMin);
Map(x => x.AmbTempMax);
Map(x => x.AmbientPressAve);
Map(x => x.AmbPressMean).Column("AmbientPressAve");
Map(x => x.AmbPressStart);
Map(x => x.AmbPressEnd);
Map(x => x.AmbPressMin);
Map(x => x.AmbPressMax);
Map(x => x.AmbientHumiAve);
Map(x => x.AmbHumiMean).Column("AmbientHumiAve");
Map(x => x.AmbHumiStart);
Map(x => x.AmbHumiEnd);
Map(x => x.AmbHumiMin);
Map(x => x.AmbHumiMax);
Map(x => x.PressUpAvrg);
Map(x => x.PressUpMean).Column("PressUpAvrg");
Map(x => x.PressUpStart);
Map(x => x.PressUpEnd);
Map(x => x.PressUpMin);
Map(x => x.PressUpMax);
Map(x => x.PressDownAvrg);
Map(x => x.PressDownMean).Column("PressDownAvrg");
Map(x => x.PressDownStart);
Map(x => x.PressDownEnd);
Map(x => x.PressDownMin);
Map(x => x.PressDownMax);
Map(x => x.TempInAvrg);
Map(x => x.TempInStart);
Map(x => x.TempInEnd);
Map(x => x.TempInMin);
Map(x => x.TempInMax);
Map(x => x.TempOutAvrg);
Map(x => x.TempOutStart);
Map(x => x.TempOutEnd);
Map(x => x.TempOutMin);
Map(x => x.TempOutMax);
Map(x => x.TempDivAvrg);
Map(x => x.PressDeltaMean);
Map(x => x.PressDeltaStart);
Map(x => x.PressDeltaEnd);
Map(x => x.PressDeltaMin);
Map(x => x.PressDeltaMax);
Map(x => x.TempUpMean).Column("TempInAvrg");
Map(x => x.TempUpStart).Column("TempInStart");
Map(x => x.TempUpEnd).Column("TempInEnd");
Map(x => x.TempUpMin).Column("TempInMin");
Map(x => x.TempUpMax).Column("TempInMax");
Map(x => x.TempDownMean).Column("TempOutAvrg");
Map(x => x.TempDownStart).Column("TempOutStart");
Map(x => x.TempDownEnd).Column("TempOutEnd");
Map(x => x.TempDownMin).Column("TempOutMin");
Map(x => x.TempDownMax).Column("TempOutMax");
Map(x => x.TempDivMean).Column("TempDivAvrg");
Map(x => x.TempDivStart);
Map(x => x.TempDivEnd);
Map(x => x.TempDivMin);
Map(x => x.TempDivMax);
Map(x => x.FlowStart);
Map(x => x.FlowEnd);
Map(x => x.FlowMin);
Map(x => x.FlowMax);
+2 -2
View File
@@ -49,10 +49,10 @@ namespace Results.Mappings
#if HEAT_METER_SUPPORT
Map(x => x.HeatMeter);
#endif
#if IPERLST || IPERLST_SPECIAL
#if IPERL
Map(x => x.WMTypeId);
Map(x => x.WMTypeRev);
#endif
}
}
}
}
+2 -2
View File
@@ -23,7 +23,7 @@ namespace Results.Mappings
Map(x => x.Passed);
Map(x => x.ResultCode);
#if IPERLST || IPERLST_SPECIAL
#if IPERL
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
@@ -35,7 +35,7 @@ namespace Results.Mappings
Map(x => x.Hz2CorrectionDone);
Map(x => x.Hz2Correction);
#endif
References(x => x.WaterMeterData);
References(x => x.WaterMeterData);
References(x => x.Batch);
HasMany(x => x.MeterTestRslts)
.Cascade.All();
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -7,9 +7,9 @@ using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using Config.Entities;
using TBF.Resources;
using Results.Resources;
namespace TBF.BenchControl.ResultsPrinters.Cevak
namespace Results.Output.Printers.Cevak
{
enum DocumentSection
{
@@ -50,7 +50,10 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
/// Data to print
///
Results.Entities.Batch batch;
TBF.BenchControl.BenchInfo.Polska.Component benchInfo;
string testBenchName;
string address1;
///
/// Items to print
@@ -75,10 +78,9 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
public PrintDocumentCevak(Results.Entities.Batch batch,
PageOrientation pageOrientation,
int topMargin, int bottomMargin, int leftMargin,
TBF.BenchControl.BenchInfo.Polska.Component benchInfo)
string testBenchName, string address1)
{
this.batch = batch;
this.benchInfo = benchInfo;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
@@ -86,19 +88,24 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
this.bottomMargin = bottomMargin;
this.leftMargin = leftMargin;
this.testBenchName = testBenchName;
this.address1 = address1;
TitleX = leftMargin;
TitleY = topMargin; /// Depends on the size of the header
HdrTop = TitleY + 60;
BodyTop = HdrTop + 250;
if (batch.WaterMeters[0].Compound())
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
}
else
{
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_SingleWM);
}
rsltItems = Results.ItemSpec.FromStrArray(new string[] {
"Test name",
"Volume",
"Reference volume",
"Test time",
"Flow",
"Error",
"Passed",
//"Reference error", // ?
});
/// Set print area size and margins (in dots using 100 dpi)
if (DefaultPageSettings.Landscape)
@@ -189,9 +196,9 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
"Název zkušební stanice: ",
"Zkušební SW, č. verze: ",
"Metodika: ", /// BenchAdresa 1
"Okolní teplota: ",
"Okolní tlak: ",
"Relativní vlhkost: ",
//"Okolní teplota: ", // Disabled, see email dated 25.11.2016
//"Okolní tlak: ",
//"Relativní vlhkost: ",
};
string[] rightColumn = new string[]
@@ -204,16 +211,16 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
batch.EndTime.Day.ToString("D2"),
batch.EndTime.Hour.ToString("D2"),
batch.EndTime.Minute.ToString("D2")),
batch.ProcedureName,
batch.ProcedureDescription,
batch.WatermetersStr,
User.CurrentUser.Name,
benchInfo.TestBenchName,
string.IsNullOrEmpty(batch.ProcedureName) ? "" : batch.ProcedureName,
string.IsNullOrEmpty(batch.ProcedureDescription) ? "" : batch.ProcedureDescription,
string.IsNullOrEmpty(batch.WatermetersStr) ? "" : batch.WatermetersStr,
string.IsNullOrEmpty(batch.UserName) ? "" : batch.UserName,
string.IsNullOrEmpty(testBenchName) ? "" : testBenchName,
string.Format("Test Bench Framework ver.{0}", batch.ProgramVersion),
benchInfo.BenchInfoCfg.Address1,
batch.AmbientTempAve().ToString("F1") + " °C",
Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar",
batch.AmbientHumiAve().ToString("F0") + " %",
string.IsNullOrEmpty(address1) ? "" : address1,
//batch.AmbientTempAve().ToString("F1") + " °C", // Disabled, see email dated 25.11.2016
//Config.Units.ConvertTo(Config.Unit.mbar, batch.AmbientPressAve()).ToString("F0") + " mbar",
//batch.AmbientHumiAve().ToString("F0") + " %",
};
/// Determine max. left column width in characters
@@ -260,7 +267,7 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
///----------
/// Footer
///----------
string footerText = string.Format("str. {1}/{2}", Strings.Page, pageNr++, nrPages);
string footerText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int footerWidth = (int)e.Graphics.MeasureString(footerText, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - SpacingOne, footerText);
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -111,10 +111,11 @@ namespace Results.Output.Printers.Munich
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
// Run base code
/// Run base code
base.OnPrintPage(e);
e.Graphics.DrawImageUnscaled(Results.Properties.Resources.Headpic, 0, 0);
/// Draw 2550 x 3507 'headpic' scaled to A4 at 100 DPI
e.Graphics.DrawImage(Results.Properties.Resources.Headpic, new Rectangle(0, 0, 827, 1137));
/// 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;
@@ -240,7 +241,7 @@ namespace Results.Output.Printers.Munich
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientPressAve().ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbientPressAve()).ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
@@ -283,7 +284,7 @@ namespace Results.Output.Printers.Munich
if (compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
PrintAt(e, FromTest(rowCnt, 2), mainMtr.VolumeMeter.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 3), auxMtr.VolumeMeter.ToString("F2"));
@@ -298,11 +299,11 @@ namespace Results.Output.Printers.Munich
PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO");
}
PrintAt(e, FromTest(rowCnt, 6), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempOutAvrg.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempDownMean.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 8), mtr.TestRslt.DensityDiv.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 9), mtr.TestTime.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 10), mtr.TestRslt.PressUpAvrg.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 11), mtr.TestRslt.PressDownAvrg.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 10), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
PrintAt(e, FromTest(rowCnt, 11), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
rowCnt++;
}
+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.11.368.0")]
[assembly: AssemblyFileVersion("2.11.368.0")]
[assembly: AssemblyVersion("2.12.486.0")]
[assembly: AssemblyFileVersion("2.12.486.0")]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 71 KiB

+189
View File
@@ -132,6 +132,24 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Category.
/// </summary>
internal static string Category {
get {
return ResourceManager.GetString("Category", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Compound.
/// </summary>
internal static string Compound {
get {
return ResourceManager.GetString("Compound", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configuration.
/// </summary>
@@ -168,6 +186,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to End mass.
/// </summary>
internal static string End_mass {
get {
return ResourceManager.GetString("End_mass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to End state.
/// </summary>
@@ -177,6 +204,33 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to End volume.
/// </summary>
internal static string End_volume {
get {
return ResourceManager.GetString("End_volume", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to End volume aux.
/// </summary>
internal static string End_volume_aux {
get {
return ResourceManager.GetString("End_volume_aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to End volume main.
/// </summary>
internal static string End_volume_main {
get {
return ResourceManager.GetString("End_volume_main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to End state aux..
/// </summary>
@@ -294,6 +348,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Heat meter.
/// </summary>
internal static string Heat_meter {
get {
return ResourceManager.GetString("Heat_meter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Item.
/// </summary>
@@ -312,6 +375,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Meter type.
/// </summary>
internal static string Meter_type {
get {
return ResourceManager.GetString("Meter_type", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mounting.
/// </summary>
@@ -339,6 +411,42 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to P delta.
/// </summary>
internal static string P_delta {
get {
return ResourceManager.GetString("P_delta", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to P delta end.
/// </summary>
internal static string P_delta_end {
get {
return ResourceManager.GetString("P_delta_end", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to P delta mean.
/// </summary>
internal static string P_delta_mean {
get {
return ResourceManager.GetString("P_delta_mean", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to P delta start.
/// </summary>
internal static string P_delta_start {
get {
return ResourceManager.GetString("P_delta_start", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to P down.
/// </summary>
@@ -393,6 +501,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Page.
/// </summary>
internal static string Page {
get {
return ResourceManager.GetString("Page", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PO.
/// </summary>
@@ -501,6 +618,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Quantity.
/// </summary>
internal static string Quantity {
get {
return ResourceManager.GetString("Quantity", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ref.pulses.
/// </summary>
@@ -573,6 +699,15 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Single.
/// </summary>
internal static string Single {
get {
return ResourceManager.GetString("Single", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to s/n.
/// </summary>
@@ -609,6 +744,42 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Start mass.
/// </summary>
internal static string Start_mass {
get {
return ResourceManager.GetString("Start_mass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Start volume.
/// </summary>
internal static string Start_volume {
get {
return ResourceManager.GetString("Start_volume", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Start volume aux.
/// </summary>
internal static string Start_volume_aux {
get {
return ResourceManager.GetString("Start_volume_aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Start volume main.
/// </summary>
internal static string Start_volume_main {
get {
return ResourceManager.GetString("Start_volume_main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to T amb.
/// </summary>
@@ -780,6 +951,24 @@ namespace Results.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Volume aux.
/// </summary>
internal static string Volume_aux {
get {
return ResourceManager.GetString("Volume_aux", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Volume main.
/// </summary>
internal static string Volume_main {
get {
return ResourceManager.GetString("Volume_main", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Width.
/// </summary>
+9
View File
@@ -186,4 +186,13 @@
<data name="Mounting" xml:space="preserve">
<value>Montáž</value>
</data>
<data name="Page" xml:space="preserve">
<value>str.</value>
</data>
<data name="Category" xml:space="preserve">
<value>Kategorie</value>
</data>
<data name="Quantity" xml:space="preserve">
<value>Veličina</value>
</data>
</root>
+19 -1
View File
@@ -133,7 +133,7 @@
<value>Stapel Nr.</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Prüfstation</value>
<value>Prüfstand</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Abbrechen</value>
@@ -363,4 +363,22 @@
<data name="Producer" xml:space="preserve">
<value>Hersteller</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>Typ</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Verbund</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value />
</data>
<data name="Single" xml:space="preserve">
<value>Einzel</value>
</data>
<data name="Category" xml:space="preserve">
<value>Kategorie</value>
</data>
<data name="Quantity" xml:space="preserve">
<value>Größe</value>
</data>
</root>
+423
View File
@@ -0,0 +1,423 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Add" xml:space="preserve">
<value>Dodać &gt;</value>
</data>
<data name="Alignment" xml:space="preserve">
<value>Wyrównywanie</value>
</data>
<data name="Approval" xml:space="preserve">
<value>Zatwierdzenie</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Dostępne wyniki:</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Nr pakietu</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Stanowisko</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Anuluj</value>
</data>
<data name="Caption" xml:space="preserve">
<value>Podpis</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>Konfiguracja</value>
</data>
<data name="Density" xml:space="preserve">
<value>Gęstość</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>W dół</value>
</data>
<data name="End" xml:space="preserve">
<value>Koniec</value>
</data>
<data name="EndState_aux" xml:space="preserve">
<value>Stan końcowy dodatkowy</value>
</data>
<data name="EndState_main" xml:space="preserve">
<value>Stan końcowy podstawowy</value>
</data>
<data name="End_state" xml:space="preserve">
<value>Stan końcowy</value>
</data>
<data name="ErrLimHi" xml:space="preserve">
<value>Max. Dopuszczalny błąd</value>
</data>
<data name="ErrLimLo" xml:space="preserve">
<value>Min. Dopuszczalny błąd</value>
</data>
<data name="Error" xml:space="preserve">
<value>Błąd</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>Zakres błędów</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Błąd dopuszczalny</value>
</data>
<data name="Err_main" xml:space="preserve">
<value>Błąd podstawowy</value>
</data>
<data name="Flow" xml:space="preserve">
<value>Przepływ</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="H_amb" xml:space="preserve">
<value>H otoczenia</value>
</data>
<data name="Item" xml:space="preserve">
<value>Pozycja</value>
</data>
<data name="MClass" xml:space="preserve">
<value>Klasa licznika</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
</data>
<data name="PO" xml:space="preserve">
<value>Zamówienie</value>
</data>
<data name="Pos" xml:space="preserve">
<value>Pozycja</value>
</data>
<data name="Precision" xml:space="preserve">
<value>Dokładność</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Procedura</value>
</data>
<data name="Producer" xml:space="preserve">
<value>Producent</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>Zapiska</value>
</data>
<data name="Pulses" xml:space="preserve">
<value>Impulsy</value>
</data>
<data name="PulsesLiter" xml:space="preserve">
<value>imp./litr</value>
</data>
<data name="P_amb" xml:space="preserve">
<value>P otoczenia</value>
</data>
<data name="P_dn_end" xml:space="preserve">
<value>P w dół koniec</value>
</data>
<data name="P_dn" xml:space="preserve">
<value>P w dół</value>
</data>
<data name="P_dn_start" xml:space="preserve">
<value>P w dół start</value>
</data>
<data name="P_up_end" xml:space="preserve">
<value>P do góry koniec</value>
</data>
<data name="P_up" xml:space="preserve">
<value>P do góry </value>
</data>
<data name="P_up_start" xml:space="preserve">
<value>P do góry strat</value>
</data>
<data name="Q_fall" xml:space="preserve">
<value>Q obniżanie</value>
</data>
<data name="Q_from" xml:space="preserve">
<value>Q od</value>
</data>
<data name="Q_rise" xml:space="preserve">
<value>Q zwiększanie</value>
</data>
<data name="Q_to" xml:space="preserve">
<value>Q do</value>
</data>
<data name="RefPulses" xml:space="preserve">
<value>Wzorcowe impulsy</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; usuń</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>Usunąć wszystko</value>
</data>
<data name="Result" xml:space="preserve">
<value>Wyniki</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>Wybierz wyniki</value>
</data>
<data name="sn" xml:space="preserve">
<value>Nr seryjny</value>
</data>
<data name="sn_aux" xml:space="preserve">
<value>Nr seryjny dodatkowy</value>
</data>
<data name="sn_main" xml:space="preserve">
<value>Nr seryjny główny</value>
</data>
<data name="Start" xml:space="preserve">
<value>Początek</value>
</data>
<data name="Test" xml:space="preserve">
<value>Test</value>
</data>
<data name="Test_ID" xml:space="preserve">
<value>ID testu</value>
</data>
<data name="Test_method" xml:space="preserve">
<value>Metoda badania</value>
</data>
<data name="Test_vol" xml:space="preserve">
<value>Objętość testu</value>
</data>
<data name="T_amb" xml:space="preserve">
<value>T otoczenia</value>
</data>
<data name="T_div" xml:space="preserve">
<value>T różnica</value>
</data>
<data name="T_end" xml:space="preserve">
<value>T końcowa</value>
</data>
<data name="T_in" xml:space="preserve">
<value>T wejściowa</value>
</data>
<data name="T_out" xml:space="preserve">
<value>T wyjściowa</value>
</data>
<data name="T_s" xml:space="preserve">
<value>T [s]</value>
</data>
<data name="T_start" xml:space="preserve">
<value>T początkowa</value>
</data>
<data name="Uncertainty" xml:space="preserve">
<value>Niepewność [%]</value>
</data>
<data name="Units" xml:space="preserve">
<value>Jednostki</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Do góry</value>
</data>
<data name="User" xml:space="preserve">
<value>Użytkownik</value>
</data>
<data name="User_nr" xml:space="preserve">
<value>Nr Użytkownika</value>
</data>
<data name="Ver" xml:space="preserve">
<value>Wersja</value>
</data>
<data name="VolRef" xml:space="preserve">
<value>Wzorzec objętości </value>
</data>
<data name="Volume" xml:space="preserve">
<value>Objętość</value>
</data>
<data name="Width" xml:space="preserve">
<value>Szerokość</value>
</data>
<data name="WMs" xml:space="preserve">
<value>Liczniki</value>
</data>
<data name="WM_Type" xml:space="preserve">
<value>Typ licznika</value>
</data>
<data name="Year" xml:space="preserve">
<value>Rok</value>
</data>
<data name="Results" xml:space="preserve">
<value>Wyniki</value>
</data>
<data name="Remark" xml:space="preserve">
<value>Uwagi</value>
</data>
<data name="Result_code" xml:space="preserve">
<value>Kod wyniku</value>
</data>
<data name="Mounting" xml:space="preserve">
<value>Montaż</value>
</data>
<data name="Energy" xml:space="preserve">
<value>Energia</value>
</data>
<data name="Energy_ref" xml:space="preserve">
<value>Wzorzec energii</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>P delta</value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>P delta końcowe</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>P delta główne</value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>P delta początkowe</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>Typ licznika</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Sprzężony</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value>Licznik ciepła</value>
</data>
<data name="Single" xml:space="preserve">
<value>Pojedynczy</value>
</data>
<data name="Page" xml:space="preserve">
<value>Strona</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>Objętość końcowa</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>Objętość początkowa</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>Dodatkowa objętość końcowa</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>Główna objętość końćowa</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>Dodatkowa objętość początkowa</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>Główna objętość początkowa</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>Objętość dodatkowa</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>Objętość główna</value>
</data>
</root>
+63
View File
@@ -369,4 +369,67 @@
<data name="Energy_ref" xml:space="preserve">
<value>Energy ref.</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>P delta</value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>P delta end</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>P delta mean</value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>P delta start</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>Meter type</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Compound</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value>Heat meter</value>
</data>
<data name="Single" xml:space="preserve">
<value>Single</value>
</data>
<data name="Page" xml:space="preserve">
<value>Page</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>End volume</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>Start volume</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>End volume aux</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>End volume main</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>Start volume aux</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>Start volume main</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>Volume aux</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>Volume main</value>
</data>
<data name="End_mass" xml:space="preserve">
<value>End mass</value>
</data>
<data name="Start_mass" xml:space="preserve">
<value>Start mass</value>
</data>
<data name="Category" xml:space="preserve">
<value>Category</value>
</data>
<data name="Quantity" xml:space="preserve">
<value>Quantity</value>
</data>
</root>
+423
View File
@@ -0,0 +1,423 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Add" xml:space="preserve">
<value>Добавить &gt;</value>
</data>
<data name="Alignment" xml:space="preserve">
<value>Выравнивание</value>
</data>
<data name="Approval" xml:space="preserve">
<value>Утверждение</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Доступные результаты</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>№ пакета</value>
</data>
<data name="Bench" xml:space="preserve">
<value>Установка</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Отмена</value>
</data>
<data name="Caption" xml:space="preserve">
<value>Подпись</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>Конфигурация</value>
</data>
<data name="Density" xml:space="preserve">
<value>Плотность</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Вниз</value>
</data>
<data name="End" xml:space="preserve">
<value>Конец</value>
</data>
<data name="EndState_aux" xml:space="preserve">
<value>Конечн. сост. доп.</value>
</data>
<data name="EndState_main" xml:space="preserve">
<value>Конечн. сост. главн.</value>
</data>
<data name="End_state" xml:space="preserve">
<value>Итог</value>
</data>
<data name="ErrLimHi" xml:space="preserve">
<value>Макс.допуст.погр.</value>
</data>
<data name="ErrLimLo" xml:space="preserve">
<value>Мин.доп.погр</value>
</data>
<data name="Error" xml:space="preserve">
<value>Ошибка</value>
</data>
<data name="ErrRef" xml:space="preserve">
<value>Err.ref.</value>
</data>
<data name="Err_aux" xml:space="preserve">
<value>Погр.доп.</value>
</data>
<data name="Err_main" xml:space="preserve">
<value>Погр.глав.</value>
</data>
<data name="Flow" xml:space="preserve">
<value>Расход</value>
</data>
<data name="Format" xml:space="preserve">
<value>Формат</value>
</data>
<data name="H_amb" xml:space="preserve">
<value>H amb</value>
</data>
<data name="Item" xml:space="preserve">
<value>Item</value>
</data>
<data name="MClass" xml:space="preserve">
<value>M.Class</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
</data>
<data name="PO" xml:space="preserve">
<value>PO</value>
</data>
<data name="Pos" xml:space="preserve">
<value>Pos.</value>
</data>
<data name="Precision" xml:space="preserve">
<value>Точность</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Процедура</value>
</data>
<data name="Producer" xml:space="preserve">
<value>Производитель</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>Протокол</value>
</data>
<data name="Pulses" xml:space="preserve">
<value>Импульсы</value>
</data>
<data name="PulsesLiter" xml:space="preserve">
<value>Импульсы/л</value>
</data>
<data name="P_amb" xml:space="preserve">
<value>P amb</value>
</data>
<data name="P_dn_end" xml:space="preserve">
<value>P вниз конец</value>
</data>
<data name="P_dn" xml:space="preserve">
<value>P вниз</value>
</data>
<data name="P_dn_start" xml:space="preserve">
<value>P вниз начало</value>
</data>
<data name="P_up_end" xml:space="preserve">
<value>P вверз конец</value>
</data>
<data name="P_up" xml:space="preserve">
<value>P вверх</value>
</data>
<data name="P_up_start" xml:space="preserve">
<value>P вверх начало</value>
</data>
<data name="Q_fall" xml:space="preserve">
<value>Q пониж</value>
</data>
<data name="Q_from" xml:space="preserve">
<value>Q от</value>
</data>
<data name="Q_rise" xml:space="preserve">
<value>Q повыш</value>
</data>
<data name="Q_to" xml:space="preserve">
<value>Q до</value>
</data>
<data name="RefPulses" xml:space="preserve">
<value>Эт.импульсы</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; Удалить</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>Удалить все</value>
</data>
<data name="Result" xml:space="preserve">
<value>Результат</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>Выбанные результаты</value>
</data>
<data name="sn" xml:space="preserve">
<value>С/Н:</value>
</data>
<data name="sn_aux" xml:space="preserve">
<value>С/Н доп</value>
</data>
<data name="sn_main" xml:space="preserve">
<value>С/Н главн</value>
</data>
<data name="Start" xml:space="preserve">
<value>Начало</value>
</data>
<data name="Test" xml:space="preserve">
<value>Тест</value>
</data>
<data name="Test_ID" xml:space="preserve">
<value>ID теста</value>
</data>
<data name="Test_method" xml:space="preserve">
<value>Метод испытания</value>
</data>
<data name="Test_vol" xml:space="preserve">
<value>Тест.объем</value>
</data>
<data name="T_amb" xml:space="preserve">
<value>T amb</value>
</data>
<data name="T_div" xml:space="preserve">
<value>T div</value>
</data>
<data name="T_end" xml:space="preserve">
<value>T оконч.</value>
</data>
<data name="T_in" xml:space="preserve">
<value>T вх</value>
</data>
<data name="T_out" xml:space="preserve">
<value>T вых</value>
</data>
<data name="T_s" xml:space="preserve">
<value>T [с]</value>
</data>
<data name="T_start" xml:space="preserve">
<value>T начала</value>
</data>
<data name="Uncertainty" xml:space="preserve">
<value>Неопределенность</value>
</data>
<data name="Units" xml:space="preserve">
<value>Единицы</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Вверх</value>
</data>
<data name="User" xml:space="preserve">
<value>Пользователь</value>
</data>
<data name="User_nr" xml:space="preserve">
<value>№ пользователя</value>
</data>
<data name="Ver" xml:space="preserve">
<value>Эт.</value>
</data>
<data name="VolRef" xml:space="preserve">
<value>Об.эт.</value>
</data>
<data name="Volume" xml:space="preserve">
<value>Объем</value>
</data>
<data name="Width" xml:space="preserve">
<value>Ширина</value>
</data>
<data name="WMs" xml:space="preserve">
<value>Счетчики</value>
</data>
<data name="WM_Type" xml:space="preserve">
<value>Тип счетчика</value>
</data>
<data name="Year" xml:space="preserve">
<value>Год</value>
</data>
<data name="Results" xml:space="preserve">
<value>Результаты</value>
</data>
<data name="Remark" xml:space="preserve">
<value>Примечание</value>
</data>
<data name="Result_code" xml:space="preserve">
<value>Код результата</value>
</data>
<data name="Mounting" xml:space="preserve">
<value>Монтаж</value>
</data>
<data name="Energy" xml:space="preserve">
<value>Энергия</value>
</data>
<data name="Energy_ref" xml:space="preserve">
<value>Эт. энергия</value>
</data>
<data name="P_delta" xml:space="preserve">
<value>P дельта</value>
</data>
<data name="P_delta_end" xml:space="preserve">
<value>P дельта кон</value>
</data>
<data name="P_delta_mean" xml:space="preserve">
<value>P дельта ср</value>
</data>
<data name="P_delta_start" xml:space="preserve">
<value>P дельта нач</value>
</data>
<data name="Meter_type" xml:space="preserve">
<value>Тип счетчика</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Комбинированный</value>
</data>
<data name="Heat_meter" xml:space="preserve">
<value>Теплосчетчик</value>
</data>
<data name="Single" xml:space="preserve">
<value>Единый</value>
</data>
<data name="Page" xml:space="preserve">
<value>Страница</value>
</data>
<data name="End_volume" xml:space="preserve">
<value>Кон. объем</value>
</data>
<data name="Start_volume" xml:space="preserve">
<value>Нач. объем</value>
</data>
<data name="End_volume_aux" xml:space="preserve">
<value>Кон. объем доп.</value>
</data>
<data name="End_volume_main" xml:space="preserve">
<value>Кон. объем главн.</value>
</data>
<data name="Start_volume_aux" xml:space="preserve">
<value>Нач. объем доп.</value>
</data>
<data name="Start_volume_main" xml:space="preserve">
<value>Нач. объем главн.</value>
</data>
<data name="Volume_aux" xml:space="preserve">
<value>Объем доп.</value>
</data>
<data name="Volume_main" xml:space="preserve">
<value>Объем главн.</value>
</data>
</root>
+10 -13
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MALTA_WSD25</DefineConstants>
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MALTA_WSD25</DefineConstants>
<DefineConstants>TRACE;MUNICH;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -90,6 +90,9 @@
<Compile Include="Mappings\TestRsltMap.cs" />
<Compile Include="Mappings\WaterMeterDataMap.cs" />
<Compile Include="Mappings\WaterMeterMap.cs" />
<Compile Include="Output\Printers\Cevak\PrintDocumentCevak.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Output\Printers\Munich\MunichPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
@@ -105,12 +108,6 @@
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="UiControls\BatchResultsCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UiControls\BatchResultsCtrl.Designer.cs">
<DependentUpon>BatchResultsCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Utils.cs" />
<Compile Include="WMeterRsltItemSpec.cs" />
</ItemGroup>
@@ -124,7 +121,6 @@
<Folder Include="FileWriters\" />
<Folder Include="Output\FileWriters\Basic\" />
<Folder Include="Output\FileWriters\Enhanced\" />
<Folder Include="Printers\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\BatchResultsDlg.resx">
@@ -141,14 +137,15 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="UiControls\BatchResultsCtrl.resx">
<DependentUpon>BatchResultsCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.ru.resx" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Headpic.png" />
-57
View File
@@ -1,57 +0,0 @@
namespace Results.UiControls
{
partial class BatchResultsCtrl
{
/// <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.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// flowLayoutPanel
//
this.flowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel.Name = "flowLayoutPanel";
this.flowLayoutPanel.Size = new System.Drawing.Size(1000, 735);
this.flowLayoutPanel.TabIndex = 0;
//
// BatchResultsCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.flowLayoutPanel);
this.Name = "BatchResultsCtrl";
this.Size = new System.Drawing.Size(1000, 735);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
}
}
-358
View File
@@ -1,358 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Config.Entities;
namespace Results.UiControls
{
public partial class BatchResultsCtrl : UserControl
{
static readonly ILog log = LogManager.GetLogger(typeof(BatchResultsCtrl));
///
/// Public members
///
public MetersArrangement MetersArrangement;
public TestsArrangement TestsArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.ItemSpec> RsltItems_Screen_CombinedWM;
public int[] RsltsClmnWidths
{
get
{
if (firstListView == null) return null;
/// Update and return column widths
int[] temp = new int[firstListView.Columns.Count];
for (int i = 0; i < firstListView.Columns.Count; i++)
{
temp[i] = firstListView.Columns[i].Width;
}
rsltsClmnWidths = temp;
return temp;
}
set
{
rsltsClmnWidths = value;
}
}
public bool Compound { get { return Compound; } } /// To inform configuration dialog which configuration is active
///
/// Private members
///
Results.BatchResults results;
bool compound;
ListView firstListView;
public int[] rsltsClmnWidths;
int rsltsClmnCount { get { return (rsltsClmnWidths != null) ? rsltsClmnWidths.Length : 0; } }
int lvWidth;
int lvHeight;
public BatchResultsCtrl()
{
InitializeComponent();
}
public void Display(Results.BatchResults results)
{
this.results = results;
Redraw();
}
/// <summary>
/// Re-draw the results. Apply new settings if they changed.
/// </summary>
public void Redraw()
{
this.SuspendLayout();
try
{
/// Determine how many water meters were enabled for result evaluation and printing
int enabledWMsCount = 0;
for (int i = 0; i < results.WMPositionsCount; i++)
{
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
{
enabledWMsCount++;
}
}
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
int nrGroups = Math.Max(1, (enabledWMsCount + NrMetersInOneGroup - 1) / metersInOneGroup);
if (MetersArrangement == MetersArrangement.Horizontally)
{
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
lvWidth = flowLayoutPanel.Width / metersInOneGroup - 6;
lvHeight = flowLayoutPanel.Height / nrGroups - 6;
}
else
{
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
lvWidth = flowLayoutPanel.Width / nrGroups - 6;
lvHeight = flowLayoutPanel.Height / metersInOneGroup - 6;
}
flowLayoutPanel.Controls.Clear();
flowLayoutPanel.WrapContents = true;
flowLayoutPanel.AutoScroll = true;
bool first = true;
for (int i = 0; i < results.WMPositionsCount; i++)
{
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
{
if (TestsArrangement == TestsArrangement.Rows)
{
ListView lview = GetResultsTestsAreRows(results.WaterMeters[i], i + 1);
if (first) { firstListView = lview; first = false; }
if (lview != null) flowLayoutPanel.Controls.Add(lview);
}
else
{
ListView lview = GetResultsTestsAreColumns(results.WaterMeters[i], i + 1);
if (first) { firstListView = lview; first = false; }
if (lview != null) flowLayoutPanel.Controls.Add(lview);
}
}
}
}
catch (Exception e)
{
log.FatalFormat("Redrawing results failed : {0}", e.Message);
if (e.InnerException != null)
{
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
}
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
}
this.ResumeLayout(false);
}
/// <summary>
/// Get an empty ListView control with appropriate parameters.
/// </summary>
/// <returns>ListView control</returns>
ListView GetListView()
{
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;
}
/// <summary>
/// Get decorated test names for a specified watermeter
/// </summary>
/// <param name="wMtr">Watermeter results entity</param>
/// <returns>A list of strings</returns>
IList<string> GetAllDecoratedTestNames(Results.Entities.WaterMeter wMtr)
{
IList<string> testNames = new List<string>();
foreach (var mtr in wMtr.MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
testNames.Add(mtr.Name());
}
}
return testNames;
}
/// <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)
{
compound = wMtr.Compound();
ListView lview = GetListView();
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int i = 1;
foreach (var item in items)
{
lview.Columns.Add(item.ClmnHeaderText, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
i++;
}
IList<string> testNames = GetAllDecoratedTestNames(wMtr);
int ix = 0;
foreach (var mtr in wMtr.MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
ListViewItem lvi = new ListViewItem(testNames[ix++]);
foreach (var item in items)
{
string str;
if (compound)
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
}
else
{
str = item.CanPrintSingle ? item.Print(mtr) : string.Empty;
}
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
lview.Items.Add(lvi);
}
}
return lview;
}
/// <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 GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
compound = wMtr.Compound();
ListView lview = GetListView();
IList<Results.ItemSpec> items = (compound ? RsltItems_Screen_CombinedWM : RsltItems_Screen_SingleWM);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int i = 1;
foreach (var str in GetAllDecoratedTestNames(wMtr))
{
lview.Columns.Add(str, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
i++;
}
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.ClmnHeaderText);
if (compound)
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.CompoundMeterId == (byte)CompoundMeterId.Compound && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
var main = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
var aux = wMtr.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
string str = (item.CanPrintCompoundMeter && main != null && aux != null)
? item.PrintCombined(main, aux, mtr)
: string.Empty;
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
}
else
{
foreach (var mtr in wMtr.MeterTestRslts)
{
if (mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
string str = !item.CanPrintSingle ? string.Empty : item.Print(mtr);
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
}
}
}
lview.Items.Add(lvi);
}
return lview;
}
}
}
+19 -2
View File
@@ -15,11 +15,28 @@ namespace Results
return string.Format("{0} ({1}/{2})", name, repetitionNr, repeats);
}
public static int BenchIdOracle2Asc(int benchIdOracle)
{
switch (benchIdOracle)
{
case 4: return 35; /// WR9
case 5: return 33; /// WR10
case 6: return 34; /// WR11
case 7: return 29; /// PT7, special
case 8: return 36; /// WR13
case 9: return 37; /// WR15
case 10: return 38; /// WR16
default: return 0;
}
}
/// <summary>
/// Converts float number to a string with the specified number of valid digits
/// Converts float number to a string with the specified number of significant digits
/// </summary>
/// <param name="value">Float value to be converted to a string</param>
/// <param name="validDigits">Number of valid digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
/// <param name="validDigits">Number of significant digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
/// <returns>String representation of the float number</returns>
public static string DoubleToStr(double value, int validDigits)
{
+209 -130
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -18,7 +18,9 @@ namespace Results
public readonly int Uid;
public readonly string OldUid;
public readonly string Name; /// Name-s of all items must be unique
public readonly string ToolTipText; /// Tool-Tip Text
public readonly Quantity Quantity; /// Quantity
public readonly ItemCategory Category; ///
public string Caption; /// Specifies item description to be printed as a caption (in the header, etc.)
public string TestID; /// Specifies the test
public Config.Unit Units; /// Specifies units for the output
@@ -29,7 +31,7 @@ namespace Results
public WMeterRsltItemSpec Clone()
{
WMeterRsltItemSpec item2 = new WMeterRsltItemSpec((ItemID)Uid, Name, Quantity, printDlgt);
WMeterRsltItemSpec item2 = new WMeterRsltItemSpec((ItemID)Uid, Name, ToolTipText, Quantity, Category, printDlgt);
item2.Caption = Caption;
item2.TestID = TestID;
item2.Units = Units;
@@ -43,14 +45,18 @@ namespace Results
///
/// Function to pick a MeterTestResult field and convert it into a string
///
public delegate string PrintDlgt(WaterMeter waterMeterResult, string testID, Config.Unit units, string format, string precision);
public delegate string PrintDlgt(WaterMeter waterMeterResult, string testID, Config.Unit units, string format, string precision);
private readonly PrintDlgt printDlgt;
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
public string Print(WaterMeter waterMeterResult)
public string Print(WaterMeter waterMeterResult)
{
string str = printDlgt(waterMeterResult, TestID, Units, Format, Precision);
return Print(waterMeterResult, TestID);
}
public string Print(WaterMeter waterMeterResult, string testId)
{
string str = printDlgt(waterMeterResult, testId, Units, Format, Precision);
if (str == null) str = string.Empty;
if (!string.IsNullOrEmpty(Format))
@@ -81,12 +87,28 @@ namespace Results
///
/// Public constructor
///
public WMeterRsltItemSpec(ItemID itemId, string name, Quantity quantity, PrintDlgt printDlgt)
public WMeterRsltItemSpec(ItemID itemId, string name, string toolTipText, Quantity quantity, ItemCategory category, PrintDlgt printDlgt)
{
Uid = (int)itemId;
OldUid = itemId.ToString().Replace("__", "/").Replace('_', ' ');
Name = name;
ToolTipText = toolTipText;
Quantity = quantity;
Category = category;
this.printDlgt = printDlgt;
}
///
/// Constructorwithot ToolTip text
///
public WMeterRsltItemSpec(ItemID itemId, string name, Quantity quantity, ItemCategory category, PrintDlgt printDlgt)
{
Uid = (int)itemId;
OldUid = itemId.ToString().Replace("__", "/").Replace('_', ' ');
Name = name;
ToolTipText = string.Format("{0} bla, bla, bla", Name);
Quantity = quantity;
Category = category;
this.printDlgt = printDlgt;
}
@@ -99,140 +121,155 @@ namespace Results
{
AllItems = new List<WMeterRsltItemSpec>();
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", Quantity.String, (w, t, u, f, p) => f));
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => f));
/// Common
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + " *", Quantity.String, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, (w, t, u, f, p) => w.ProcedureName()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, (w, t, u, f, p) => w.BatchNr().ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + " *", Quantity.String, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " *", Quantity.Density, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).DensityOut.ToString(string.IsNullOrEmpty(p) ? "F1" : p))); /// [kg/m3]
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test, Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => (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) => w.ProcedureName()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.BatchNr().ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + " *", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " *", Quantity.Density, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).DensityOut.ToString(string.IsNullOrEmpty(p) ? "F1" : p))); /// [kg/m3]
/// Target values
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, Strings.Q_from + "()", Quantity.Flow, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, Strings.Q_to + "()", Quantity.Flow, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, Strings.Q_from + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qfrom().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, Strings.Q_to + "()", Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Qto().ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TargetVolume()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimLo()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrLimHi()).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Uncertainty().ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
/// Test results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, Strings.Flow + "()", Quantity.Flow, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_in, Strings.T_in + "()", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempInAvrg).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_out, Strings.T_out + "()", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempOutAvrg).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, Strings.T_div + "()", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivAvrg).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, Strings.P_up + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpAvrg).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, Strings.P_up_start + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, Strings.P_up_end + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, Strings.P_dn + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownAvrg).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, Strings.P_dn_start + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, Strings.P_dn_end + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, Strings.ErrRef + "()", Quantity.Error, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, Strings.T_amb + "()", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientTempAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientTempAve).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, Strings.P_amb + "()", Quantity.Pressure, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientPressAve()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientPressAve).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, Strings.H_amb + "()", Quantity.Humidity, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientHumiAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbientHumiAve).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).TestTime.ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, Strings.Flow + "()", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Utils.DoubleToStr(Config.Units.ConvertTo(u, w.GetTestRslt(t).FlowVolume), 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, Strings.T_in + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempUpMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, Strings.T_out + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDownMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, Strings.T_div + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).TempDivMean).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, Strings.P_up + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, Strings.P_up_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, Strings.P_up_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressUpEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, Strings.P_dn + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, Strings.P_dn_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, Strings.P_dn_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDownEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, Strings.P_delta + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaMean).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, Strings.P_delta_start + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, Strings.P_delta_end + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).PressDeltaEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, Strings.ErrRef + "()", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).ErrorMaster).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, Strings.T_amb + "()", Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientTempAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbTempMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, Strings.P_amb + "()", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientPressAve()).ToString(string.IsNullOrEmpty(p) ? "F0" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbPressMean).ToString(string.IsNullOrEmpty(p) ? "F0" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, Strings.H_amb + "()", Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? Config.Units.ConvertTo(u, w.Batch.AmbientHumiAve()).ToString(string.IsNullOrEmpty(p) ? "F1" : p) : Config.Units.ConvertTo(u, w.GetTestRslt(t).AmbHumiMean).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
/// Single and combined meter results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, Strings.VolRef + "()", Quantity.Volume, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if IPERLST || IPERLST_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, Strings.Volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, Strings.VolRef + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if TURA_IPERL || TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#else
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, Strings.Error + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).Error).ToString(string.IsNullOrEmpty(p) ? "F2" : p)));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result + "()", Quantity.Boolean, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result + "()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr()));
/// Water meter info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, (w, t, u, f, p) => w.WaterMeterData.ProductName));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Producer, Strings.Producer, Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Producer));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.ProductName));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Producer, Strings.Producer, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.Producer));
AllItems.Add(new WMeterRsltItemSpec(ItemID.DN, "DN", Quantity.Length, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.DN).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.DN).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.L, "L", Quantity.Length, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.L).ToString()
AllItems.Add(new WMeterRsltItemSpec(ItemID.DN, "DN", Quantity.Length, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.DN).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.DN).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.L, "L", Quantity.Length, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.L).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.L).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mounting, Strings.Mounting, Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Mounting.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mounting, Strings.Mounting, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.Mounting.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q4, "Q4_Qmax", Quantity.Flow, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q4_Qmax).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q4_Qmax).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q3, "Q3_Qn", Quantity.Flow, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q3_Qn).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q3_Qn).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2, "Q2_Qt", Quantity.Flow, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q2_Qt).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q2_Qt).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q1, "Q1_Qmin", Quantity.Flow, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q1_Qmin).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q1_Qmin).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q4, "Q4_Qmax", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q4_Qmax).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q4_Qmax).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q3, "Q3_Qn", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q3_Qn).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q3_Qn).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2, "Q2_Qt", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q2_Qt).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q2_Qt).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q1, "Q1_Qmin", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? Config.Units.ConvertTo(u, w.WaterMeterData.Q1_Qmin).ToString()
: Config.Units.ConvertTo(u, w.WaterMeterData.Q1_Qmin).ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Metrological_class, Strings.MClass, Quantity.String, (w, t, u, f, p) => w.WaterMeterData.MetrologicalClass));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Temperature_class, "Temperature class", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.TemperatureClass.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pressure_loss_class, "Pressure loss class", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.PressureLossClass.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_admissible_pressure, "Max. admissible pressure", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.MaxAdmissiblePressure.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_profile_sensitivity_class, "Flow profile sensitivity class", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.FlowProfileSensitivityClass.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Metrological_class, Strings.MClass, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.MetrologicalClass));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Temperature_class, "Temperature class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.TemperatureClass.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pressure_loss_class, "Pressure loss class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.PressureLossClass.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_admissible_pressure, "Max. admissible pressure", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.MaxAdmissiblePressure.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_profile_sensitivity_class, "Flow profile sensitivity class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.FlowProfileSensitivityClass.ToDescription()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Approval_info, Strings.Approval, Quantity.String, (w, t, u, f, p) => w.WaterMeterData.ApprovalInfo));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Certificate));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Approval_info, Strings.Approval, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.ApprovalInfo));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => w.WaterMeterData.Certificate));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? w.WaterMeterData.PulsesPerLtr.ToString()
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? w.WaterMeterData.PulsesPerLtr.ToString()
: w.WaterMeterData.PulsesPerLtr.ToString(p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Text1));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Text2));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text3, "Text3", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Text3));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text4, "Text4", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Text4));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text5, "Text5", Quantity.String, (w, t, u, f, p) => w.WaterMeterData.Text5));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text1));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text2));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text3, "Text3", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text3));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text4, "Text4", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text4));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text5, "Text5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Text5));
/// Water meters results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Quantity.String, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Purchase_order, Strings.PO, Quantity.String, (w, t, u, f, p) => w.PurchaseOrder));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Year_of_production, Strings.Year, Quantity.Number, (w, t, u, f, p) => w.YearOfProduction.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_Position, Strings.Pos, Quantity.Number, (w, t, u, f, p) => w.WMPosition.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Purchase_order, Strings.PO, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.PurchaseOrder));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Year_of_production, Strings.Year, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.YearOfProduction.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_Position, Strings.Pos, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.WMPosition.ToString()));
/// Water meters results (single)
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state, Strings.End_state, Quantity.String, (w, t, u, f, p) => w.EndState));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses, Strings.Pulses + "()", Quantity.Number, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PulsesMeter.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t).PulsesPerLiter.ToString()
: w.GetMeterTestRslt(t).PulsesPerLiter.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Number, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PulsesMaster.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state, Strings.End_state, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndState));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses, Strings.Pulses + "()", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PulsesMeter.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t).PulsesPerLiter.ToString()
: w.GetMeterTestRslt(t).PulsesPerLiter.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PulsesMaster.ToString()));
/// Water meters results (combined)
//AllItems.Add(new ItemSpec("Q rise", "Q rise [m3/h]", null, (x, y, z) => (z.QRise() == 0) ? "-" : Utils.DoubleToStr(z.QRise(), 4)));
//AllItems.Add(new ItemSpec("Q fall", "Q fall [m3/h]", null, (x, y, z) => (z.QFall() == 0) ? "-" : Utils.DoubleToStr(z.QFall(), 4)));
//AllItems.Add(new ItemSpec("Error large WM", "Error-L [%]", null, (x, y, z) => x.Error.ToString("F2")));
//AllItems.Add(new ItemSpec("Error small WM", "Error-S [%]", null, (x, y, z) => y.Error.ToString("F2")));
//AllItems.Add(new ItemSpec("Serial Nr large WM", "s/n", null, (x, y, z) => x.SerialNr()));
//AllItems.Add(new ItemSpec("Serial Nr small WM", "s/n", null, (x, y, z) => y.SerialNr()));
//AllItems.Add(new ItemSpec("End state large WM", "End state", null, (x, y, z) => x.EndState()));
//AllItems.Add(new ItemSpec("End state small WM", "End state", null, (x, y, z) => y.EndState()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, Strings.Q_rise, Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QRise == 0) ? "-" : Utils.DoubleToStr(w.QRise, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, Strings.Q_fall, Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (w.QFall == 0) ? "-" : Utils.DoubleToStr(w.QFall, 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString()
: w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : (string.IsNullOrEmpty(p) ? w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error.ToString()
: w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error.ToString(p))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, Strings.sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, Strings.sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.SerialNrAux));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndState));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => w.EndStateAux));
/// Batch info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_bench_ID, Strings.Bench, Quantity.String, (w, t, u, f, p) => w.Batch.TestBenchId.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, (w, t, u, f, p) => w.Batch.ProgramVersion));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, (w, t, u, f, p) => w.Batch.UserName));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, (w, t, u, f, p) => w.Batch.UserNumber.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, (w, t, u, f, p) => w.Batch.WatermetersStr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Protocol_title, Strings.Protocol, Quantity.String, (w, t, u, f, p) => w.Batch.ProtocolTitle));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? ((w.WaterMeterData.PulsesPerLtr != 0) ? 1 / w.WaterMeterData.PulsesPerLtr : 0).ToString()
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_bench_ID, Strings.Bench, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.TestBenchId.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.ProgramVersion));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.UserName));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => w.Batch.UserNumber.ToString()));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.WatermetersStr));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Protocol_title, Strings.Protocol, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.Batch.ProtocolTitle));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(p) ? ((w.WaterMeterData.PulsesPerLtr != 0) ? 1 / w.WaterMeterData.PulsesPerLtr : 0).ToString()
: ((w.WaterMeterData.PulsesPerLtr != 0) ? 1 / w.WaterMeterData.PulsesPerLtr : 0).ToString(p)));
/// Extra water meter data
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.ResultCode.ToString() : string.Format(f, w.ResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, (w, t, u, f, p) => w.Batch.Remark));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.ResultCode.ToString() : string.Format(f, w.ResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, Strings.Remark, Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => w.Batch.Remark));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single)));
#if HEAT_METERS_SUPPORT
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiMean, "T hi me", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiStart, "T hi st", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiEnd, "T hi en", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiAve, "T hi av", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoMean, "T lo me", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoStart, "T lo st", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoEnd, "T lo en", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoAve, "T lo av", Quantity.Temperature, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, Strings.Volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, Strings.Volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeStart).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t).VolumeEnd).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + "()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) == null) ? "" : Config.Units.ConvertTo(u, w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef).ToString(string.IsNullOrEmpty(p) ? "F1" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiMean, "T hi me", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom1).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiStart, "T hi st", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiEnd, "T hi en", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom3).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempHiAve, "T hi av", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoMean, "T lo me", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom6).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoStart, "T lo st", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom7).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoEnd, "T lo en", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, w.GetTestRslt(t).Custom8).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TempLoAve, "T lo av", Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : Config.Units.ConvertTo(u, (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2).ToString(string.IsNullOrEmpty(p) ? "F3" : p)));
#endif
}
}
/// <summary>
/// Converts a list of 'Output item specifications' to a string array
@@ -253,7 +290,7 @@ namespace Results
items[i].Format,
items[i].Precision,
items[i].Width,
items[i].Alignment);
items[i].Alignment);
}
return result;
}
@@ -266,33 +303,75 @@ namespace Results
public static IList<WMeterRsltItemSpec> FromStrArray(string[] strArray)
{
IList<WMeterRsltItemSpec> result = new List<WMeterRsltItemSpec>();
if (strArray != null)
{
for (int i = 0; i < strArray.Length; i++)
{
string[] field = strArray[i].Split(new char[] { '~' });
try
{
WMeterRsltItemSpec item = GetItem(int.Parse(field[0]));
try
{
if (strArray[i].Contains("~"))
{
///
/// Load the new style results item specification
///
string[] field = strArray[i].Split(new char[] { '~' });
WMeterRsltItemSpec item = GetItem(int.Parse(field[0]));
item.Caption = field[1];
item.TestID = field[2];
item.Units = 0;
for (Config.Unit u = 0; u < Config.Unit.Count; u++) if (u.ToString().Equals(field[3])) { item.Units = u; break; }
item.Format = field[4];
item.Precision = field[5];
item.Width = int.Parse(field[6]);
item.Alignment = 0;
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++) if (a.ToString().Equals(field[7])) { item.Alignment = a; break; }
item.Caption = field[1];
item.TestID = field[2];
item.Units = 0;
for (Config.Unit u = 0; u < Config.Unit.Count; u++)
{
if (u.ToString().Equals(field[3])) { item.Units = u; break; }
}
item.Format = field[4];
item.Precision = field[5];
item.Width = int.Parse(field[6]);
item.Alignment = 0;
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++)
{
if (a.ToString().Equals(field[7])) { item.Alignment = a; break; }
}
result.Add(item);
}
catch
{
WMeterRsltItemSpec item = GetItem(0);
item.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item);
}
result.Add(item);
}
else
{
///
/// Try to load the old style results item specification
///
bool added = false;
foreach (var it in AllItems)
{
if (strArray[i].Equals(it.OldUid))
{
WMeterRsltItemSpec item = it.Clone();
item.Caption = item.Name.Replace("()", "").Replace(" *", "");
item.Units = 0; /// use default units
item.Format = null; /// the same like format string "{0}"
item.Precision = null;
item.Width = 0; /// do not ad any extra spaces
item.Alignment = Alignment.Left;
result.Add(item);
added = true;
break;
}
}
if (!added)
{
WMeterRsltItemSpec item = GetItem(0);
item.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item);
}
}
}
catch
{
WMeterRsltItemSpec item = GetItem(0);
item.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item);
}
}
}
return result;
+158 -136
View File
@@ -28,142 +28,162 @@
/// </summary>
private void InitializeComponent()
{
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 0;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 1;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 3;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 2;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 4;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(506, 158);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 6;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 158);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 8;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 9;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 10;
//
// languageLabel
//
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 147);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 11;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Location = new System.Drawing.Point(29, 171);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 12;
//
// 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, 232);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.connectionStringTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameLabel = new System.Windows.Forms.Label();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.connectionStringTextBox2 = new System.Windows.Forms.TextBox();
this.connectionStringTextBox3 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.benchNameTextBox1 = new System.Windows.Forms.TextBox();
this.benchNameTextBox2 = new System.Windows.Forms.TextBox();
this.benchNameTextBox3 = new System.Windows.Forms.TextBox();
this.languageLabel = new System.Windows.Forms.Label();
this.languageTextBox = new System.Windows.Forms.TextBox();
this.formatLabel = new System.Windows.Forms.Label();
this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// connectionStringTextBox1
//
this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45);
this.connectionStringTextBox1.Name = "connectionStringTextBox1";
this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox1.TabIndex = 0;
//
// benchNameLabel
//
this.benchNameLabel.AutoSize = true;
this.benchNameLabel.Location = new System.Drawing.Point(26, 20);
this.benchNameLabel.Name = "benchNameLabel";
this.benchNameLabel.Size = new System.Drawing.Size(67, 13);
this.benchNameLabel.TabIndex = 1;
this.benchNameLabel.Text = "Bench name";
//
// connectionStringLabel
//
this.connectionStringLabel.AutoSize = true;
this.connectionStringLabel.Location = new System.Drawing.Point(154, 20);
this.connectionStringLabel.Name = "connectionStringLabel";
this.connectionStringLabel.Size = new System.Drawing.Size(89, 13);
this.connectionStringLabel.TabIndex = 3;
this.connectionStringLabel.Text = "Connection string";
//
// connectionStringTextBox2
//
this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71);
this.connectionStringTextBox2.Name = "connectionStringTextBox2";
this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox2.TabIndex = 2;
//
// connectionStringTextBox3
//
this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97);
this.connectionStringTextBox3.Name = "connectionStringTextBox3";
this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20);
this.connectionStringTextBox3.TabIndex = 4;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(506, 194);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 6;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(617, 194);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// benchNameTextBox1
//
this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45);
this.benchNameTextBox1.Name = "benchNameTextBox1";
this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox1.TabIndex = 8;
//
// benchNameTextBox2
//
this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71);
this.benchNameTextBox2.Name = "benchNameTextBox2";
this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox2.TabIndex = 9;
//
// benchNameTextBox3
//
this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97);
this.benchNameTextBox3.Name = "benchNameTextBox3";
this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20);
this.benchNameTextBox3.TabIndex = 10;
//
// languageLabel
//
this.languageLabel.AutoSize = true;
this.languageLabel.Location = new System.Drawing.Point(26, 183);
this.languageLabel.Name = "languageLabel";
this.languageLabel.Size = new System.Drawing.Size(55, 13);
this.languageLabel.TabIndex = 11;
this.languageLabel.Text = "Language";
//
// languageTextBox
//
this.languageTextBox.Location = new System.Drawing.Point(29, 207);
this.languageTextBox.Name = "languageTextBox";
this.languageTextBox.Size = new System.Drawing.Size(100, 20);
this.languageTextBox.TabIndex = 12;
//
// formatLabel
//
this.formatLabel.AutoSize = true;
this.formatLabel.Location = new System.Drawing.Point(26, 129);
this.formatLabel.Name = "formatLabel";
this.formatLabel.Size = new System.Drawing.Size(39, 13);
this.formatLabel.TabIndex = 13;
this.formatLabel.Text = "Format";
//
// timePeriodFormatTextBox
//
this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 151);
this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox";
this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20);
this.timePeriodFormatTextBox.TabIndex = 14;
//
// DatabaseSettingsDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(743, 254);
this.Controls.Add(this.timePeriodFormatTextBox);
this.Controls.Add(this.formatLabel);
this.Controls.Add(this.languageTextBox);
this.Controls.Add(this.languageLabel);
this.Controls.Add(this.benchNameTextBox3);
this.Controls.Add(this.benchNameTextBox2);
this.Controls.Add(this.benchNameTextBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.connectionStringTextBox3);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.connectionStringTextBox2);
this.Controls.Add(this.benchNameLabel);
this.Controls.Add(this.connectionStringTextBox1);
this.Name = "DatabaseSettingsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -181,5 +201,7 @@
private System.Windows.Forms.TextBox benchNameTextBox3;
private System.Windows.Forms.Label languageLabel;
private System.Windows.Forms.TextBox languageTextBox;
private System.Windows.Forms.Label formatLabel;
private System.Windows.Forms.TextBox timePeriodFormatTextBox;
}
}
+6 -1
View File
@@ -29,6 +29,8 @@ namespace ResultsBrowser.Forms
connectionStringTextBox2.Text = Program.LocalSettings.ConnectionString2;
connectionStringTextBox3.Text = Program.LocalSettings.ConnectionString3;
timePeriodFormatTextBox.Text = Program.LocalSettings.TimePeriodFormat;
languageTextBox.Text = Program.LocalSettings.Language;
}
@@ -36,7 +38,8 @@ namespace ResultsBrowser.Forms
{
Text = Strings.Settings;
benchNameLabel.Text = Strings.Test_bench;
connectionStringLabel.Text = Strings.Connection_string; /// TODO: Use resources
connectionStringLabel.Text = Strings.Connection_string;
formatLabel.Text = Strings.Format;
languageLabel.Text = Strings.Language;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
@@ -52,6 +55,8 @@ namespace ResultsBrowser.Forms
Program.LocalSettings.ConnectionString2 = connectionStringTextBox2.Text;
Program.LocalSettings.ConnectionString3 = connectionStringTextBox3.Text;
Program.LocalSettings.TimePeriodFormat = timePeriodFormatTextBox.Text;
Program.LocalSettings.Language = languageTextBox.Text;
Program.LocalSettings.Save();
+99 -86
View File
@@ -28,91 +28,103 @@
/// </summary>
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.statisticsListView = new System.Windows.Forms.ListView();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.okButton = new System.Windows.Forms.Button();
((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.statisticsListView);
//
// 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;
//
// statisticsListView
//
this.statisticsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.statisticsListView.GridLines = true;
this.statisticsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.statisticsListView.Location = new System.Drawing.Point(0, 0);
this.statisticsListView.Name = "statisticsListView";
this.statisticsListView.Size = new System.Drawing.Size(572, 320);
this.statisticsListView.TabIndex = 0;
this.statisticsListView.UseCompatibleStateImageBehavior = false;
//
// 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.okButton);
this.splitContainer2.Size = new System.Drawing.Size(572, 85);
this.splitContainer2.SplitterDistance = 390;
this.splitContainer2.TabIndex = 0;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(45, 20);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(108, 41);
this.okButton.TabIndex = 0;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// StatisticsDlg
//
this.AcceptButton = this.okButton;
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 = "StatisticsDlg";
this.Text = "StatisticsDlg";
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.statisticsListView = new System.Windows.Forms.ListView();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.printButton = new System.Windows.Forms.Button();
this.closeButton = new System.Windows.Forms.Button();
((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.statisticsListView);
//
// 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;
//
// statisticsListView
//
this.statisticsListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.statisticsListView.GridLines = true;
this.statisticsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.statisticsListView.Location = new System.Drawing.Point(0, 0);
this.statisticsListView.Name = "statisticsListView";
this.statisticsListView.Size = new System.Drawing.Size(572, 320);
this.statisticsListView.TabIndex = 0;
this.statisticsListView.UseCompatibleStateImageBehavior = false;
//
// 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.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;
//
// printButton
//
this.printButton.Location = new System.Drawing.Point(38, 22);
this.printButton.Name = "printButton";
this.printButton.Size = new System.Drawing.Size(108, 41);
this.printButton.TabIndex = 0;
this.printButton.Text = "Print";
this.printButton.UseVisualStyleBackColor = true;
this.printButton.Click += new System.EventHandler(this.printButton_Click);
//
// closeButton
//
this.closeButton.Location = new System.Drawing.Point(176, 22);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(108, 41);
this.closeButton.TabIndex = 1;
this.closeButton.Text = "Close";
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
//
// StatisticsDlg
//
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 = "StatisticsDlg";
this.Text = "StatisticsDlg";
this.Load += new System.EventHandler(this.StatisticsDlg_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -121,6 +133,7 @@
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ListView statisticsListView;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button closeButton;
private System.Windows.Forms.Button printButton;
}
}
+116 -40
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms;
using Results.Entities;
using ResultsBrowser.Resources;
using ResultsBrowser.Output.Printers.Statistics;
namespace ResultsBrowser.Forms
{
@@ -11,46 +12,79 @@ namespace ResultsBrowser.Forms
IList<WaterMeter> waterMeters;
bool twoDim;
//int rowItemID;
//int columnItemID;
//string rowTestSpec;
//string columnTestSpec;
Results.WMeterRsltItemSpec rowItem;
Results.WMeterRsltItemSpec columnItem;
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;
IList<string> rowValues;
IList<string> columnValues;
public StatisticsDlg(IList<WaterMeter> waterMeters, bool twoDim, int rowItemID, int columnItemID, string rowTestSpec, string columnTestSpec)
int[,] occurances;
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,
DateTime startDate, DateTime endDate)
{
InitializeComponent();
Text = Strings.Statistics;
okButton.Text = Strings.OkBtnText;
if (!string.IsNullOrEmpty(Program.LocalSettings.TimePeriodFormat) && (startDate != new DateTime(0)) && (endDate != new DateTime(0)))
{
title = string.Format(Program.LocalSettings.TimePeriodFormat, startDate, endDate);
}
else
{
title = Strings.Statistics;
}
Text = title;
closeButton.Text = Strings.OkBtnText;
printButton.Text = Strings.Print;
this.waterMeters = waterMeters;
this.twoDim = twoDim;
foreach (var item in Results.WMeterRsltItemSpec.AllItems)
{
if (item.Uid == rowItemID)
{
rowItem = item.Clone();
item.TestID = rowTestSpec;
}
if (twoDim && item.Uid == columnItemID)
{
columnItem = item.Clone();
item.TestID = columnTestSpec;
}
}
this.rowItem = rowItem;
this.rowItem2 = rowItem2;
this.rowItem3 = rowItem3;
//this.rowItemID = rowItemID;
//this.columnItemID = columnItemID;
//this.rowTestSpec = rowTestSpec;
//this.columnTestSpec = columnTestSpec;
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)
@@ -71,38 +105,50 @@ namespace ResultsBrowser.Forms
foreach (var wm in waterMeters)
{
string value = rowItem.Print(wm);
if (!rowValues.Contains(value)) rowValues.Add(value);
if (rowItem2 != null) value = value + " | " + rowItem2.Print(wm);
if (rowItem3 != null) value = value + " | " + rowItem3.Print(wm);
if (!rowValues.Contains(value)) rowValues.Add(value);
if (twoDim)
{
value = columnItem.Print(wm);
if (!columnValues.Contains(value)) columnValues.Add(value);
if (columnItem2 != null) value = value + " | " + columnItem2.Print(wm);
if (columnItem3 != null) value = value + " | " + columnItem3.Print(wm);
if (!columnValues.Contains(value)) columnValues.Add(value);
}
}
///
/// Calculate occurances
///
int columns = Math.Max(1, columnValues.Count);
int[,] occurances = new int[rowValues.Count, columns];
int columnsCount = Math.Max(1, columnValues.Count);
occurances = new int[rowValues.Count, columnsCount];
foreach (var wm in waterMeters)
{
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);
if (twoDim)
{
for (int column = 0; column < columns; column++)
for (int column = 0; column < columnsCount; column++)
{
if (rowItem.Print(wm).Equals(rowValues[row]) && columnItem.Print(wm).Equals(columnValues[column]))
{
occurances[row, column]++;
}
string columnValue = columnItem.Print(wm);
if (columnItem2 != null) columnValue = columnValue + " | " + columnItem2.Print(wm);
if (columnItem3 != null) columnValue = columnValue + " | " + columnItem3.Print(wm);
if (rowValue == rowValues[row] && columnValue == columnValues[column])
{
occurances[row, column]++;
}
}
}
else
{
if (rowItem.Print(wm).Equals(rowValues[row])) occurances[row, 0]++;
if (rowValue == rowValues[row]) occurances[row, 0]++;
}
}
}
@@ -114,16 +160,16 @@ namespace ResultsBrowser.Forms
statisticsListView.GridLines = true;
statisticsListView.FullRowSelect = true;
statisticsListView.Columns.Add("*", 200);
for (int column = 0; column < columns; column++)
statisticsListView.Columns.Add(" ", 200);
for (int column = 0; column < columnsCount; column++)
{
statisticsListView.Columns.Add((twoDim ? columnValues[column] : "Count"), 70);
statisticsListView.Columns.Add((twoDim ? columnValues[column] : Strings.Count), 70);
}
for (int row = 0; row < rowValues.Count; row++)
{
ListViewItem lvi = new ListViewItem(rowValues[row]);
for (int column = 0; column < columns; column++) lvi.SubItems.Add(occurances[row, column].ToString());
for (int column = 0; column < columnsCount; column++) lvi.SubItems.Add(occurances[row, column].ToString());
statisticsListView.Items.Add(lvi);
}
@@ -136,10 +182,40 @@ namespace ResultsBrowser.Forms
}
}
private void okButton_Click(object sender, EventArgs e)
private void closeButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void printButton_Click(object sender, EventArgs e)
{
int columnsCount = Math.Max(1, columnValues.Count);
string[,] table = new string[rowValues.Count + 1, columnsCount + 1];
table[0, 0] = string.Empty;
for (int column = 0; column < columnsCount; column++)
{
table[0, column + 1] = (twoDim ? columnValues[column] : Strings.Count);
}
for (int row = 0; row < rowValues.Count; row++)
{
table[row + 1, 0] = rowValues[row];
for (int column = 0; column < columnsCount; column++) table[row + 1, column + 1] = occurances[row, column].ToString();
}
switch (MessageBox.Show(Strings.Yes_Portrait_No_Landscape, Strings.Page_orientation, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
{
case DialogResult.Yes:
new StatisticsPrintDocument(title, table, Config.Entities.PageOrientation.Portrait).Print();
break;
case DialogResult.No:
new StatisticsPrintDocument(title, table, Config.Entities.PageOrientation.Landscape).Print();
break;
default:
break;
}
}
}
}
+273 -141
View File
@@ -28,147 +28,267 @@
/// </summary>
private void InitializeComponent()
{
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.rowsGroupBox = new System.Windows.Forms.GroupBox();
this.rowTestSpecTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.rowsComboBox = new System.Windows.Forms.ComboBox();
this.columnsGroupBox = new System.Windows.Forms.GroupBox();
this.columnTestSpecTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.columnsComboBox = new System.Windows.Forms.ComboBox();
this.twoDimCheckBox = new System.Windows.Forms.CheckBox();
this.rowsGroupBox.SuspendLayout();
this.columnsGroupBox.SuspendLayout();
this.SuspendLayout();
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(368, 196);
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.Location = new System.Drawing.Point(257, 196);
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);
//
// rowsGroupBox
//
this.rowsGroupBox.Controls.Add(this.rowTestSpecTextBox);
this.rowsGroupBox.Controls.Add(this.label1);
this.rowsGroupBox.Controls.Add(this.rowsComboBox);
this.rowsGroupBox.Location = new System.Drawing.Point(38, 50);
this.rowsGroupBox.Name = "rowsGroupBox";
this.rowsGroupBox.Size = new System.Drawing.Size(427, 56);
this.rowsGroupBox.TabIndex = 10;
this.rowsGroupBox.TabStop = false;
this.rowsGroupBox.Text = "Rows";
//
// rowTestSpecTextBox
//
this.rowTestSpecTextBox.Location = new System.Drawing.Point(326, 22);
this.rowTestSpecTextBox.Name = "rowTestSpecTextBox";
this.rowTestSpecTextBox.Size = new System.Drawing.Size(61, 20);
this.rowTestSpecTextBox.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(242, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
//
// rowsComboBox
//
this.rowsComboBox.FormattingEnabled = true;
this.rowsComboBox.Location = new System.Drawing.Point(32, 21);
this.rowsComboBox.Name = "rowsComboBox";
this.rowsComboBox.Size = new System.Drawing.Size(185, 21);
this.rowsComboBox.TabIndex = 0;
//
// columnsGroupBox
//
this.columnsGroupBox.Controls.Add(this.columnTestSpecTextBox);
this.columnsGroupBox.Controls.Add(this.label2);
this.columnsGroupBox.Controls.Add(this.columnsComboBox);
this.columnsGroupBox.Location = new System.Drawing.Point(38, 112);
this.columnsGroupBox.Name = "columnsGroupBox";
this.columnsGroupBox.Size = new System.Drawing.Size(427, 56);
this.columnsGroupBox.TabIndex = 11;
this.columnsGroupBox.TabStop = false;
this.columnsGroupBox.Text = "Columns";
//
// columnTestSpecTextBox
//
this.columnTestSpecTextBox.Location = new System.Drawing.Point(326, 21);
this.columnTestSpecTextBox.Name = "columnTestSpecTextBox";
this.columnTestSpecTextBox.Size = new System.Drawing.Size(61, 20);
this.columnTestSpecTextBox.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(242, 23);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 13);
this.label2.TabIndex = 2;
this.label2.Text = "label2";
//
// columnsComboBox
//
this.columnsComboBox.FormattingEnabled = true;
this.columnsComboBox.Location = new System.Drawing.Point(32, 20);
this.columnsComboBox.Name = "columnsComboBox";
this.columnsComboBox.Size = new System.Drawing.Size(185, 21);
this.columnsComboBox.TabIndex = 1;
//
// twoDimCheckBox
//
this.twoDimCheckBox.AutoSize = true;
this.twoDimCheckBox.Location = new System.Drawing.Point(39, 21);
this.twoDimCheckBox.Name = "twoDimCheckBox";
this.twoDimCheckBox.Size = new System.Drawing.Size(40, 17);
this.twoDimCheckBox.TabIndex = 12;
this.twoDimCheckBox.Text = "2D";
this.twoDimCheckBox.UseVisualStyleBackColor = true;
this.twoDimCheckBox.CheckedChanged += new System.EventHandler(this.twoDimCheckBox_CheckedChanged);
//
// StatisticsOptionsDlg
//
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, 262);
this.Controls.Add(this.columnsGroupBox);
this.Controls.Add(this.twoDimCheckBox);
this.Controls.Add(this.rowsGroupBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Name = "StatisticsOptionsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "StatisticsOptionsDlg";
this.Load += new System.EventHandler(this.StatisticsOptionsDlg_Load);
this.rowsGroupBox.ResumeLayout(false);
this.rowsGroupBox.PerformLayout();
this.columnsGroupBox.ResumeLayout(false);
this.columnsGroupBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.rowsGroupBox = new System.Windows.Forms.GroupBox();
this.rowTestSpecTextBox2 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.rowsComboBox2 = new System.Windows.Forms.ComboBox();
this.rowTestSpecTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.rowsComboBox = new System.Windows.Forms.ComboBox();
this.columnsGroupBox = new System.Windows.Forms.GroupBox();
this.columnTestSpecTextBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.columnsComboBox2 = new System.Windows.Forms.ComboBox();
this.columnTestSpecTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.columnsComboBox = new System.Windows.Forms.ComboBox();
this.twoDimCheckBox = new System.Windows.Forms.CheckBox();
this.rowTestSpecTextBox3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.rowsComboBox3 = new System.Windows.Forms.ComboBox();
this.columnTestSpecTextBox3 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.columnsComboBox3 = new System.Windows.Forms.ComboBox();
this.rowsGroupBox.SuspendLayout();
this.columnsGroupBox.SuspendLayout();
this.SuspendLayout();
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(368, 294);
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.Location = new System.Drawing.Point(257, 294);
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);
//
// rowsGroupBox
//
this.rowsGroupBox.Controls.Add(this.rowTestSpecTextBox3);
this.rowsGroupBox.Controls.Add(this.label5);
this.rowsGroupBox.Controls.Add(this.rowsComboBox3);
this.rowsGroupBox.Controls.Add(this.rowTestSpecTextBox2);
this.rowsGroupBox.Controls.Add(this.label4);
this.rowsGroupBox.Controls.Add(this.rowsComboBox2);
this.rowsGroupBox.Controls.Add(this.rowTestSpecTextBox);
this.rowsGroupBox.Controls.Add(this.label1);
this.rowsGroupBox.Controls.Add(this.rowsComboBox);
this.rowsGroupBox.Location = new System.Drawing.Point(38, 50);
this.rowsGroupBox.Name = "rowsGroupBox";
this.rowsGroupBox.Size = new System.Drawing.Size(427, 112);
this.rowsGroupBox.TabIndex = 10;
this.rowsGroupBox.TabStop = false;
this.rowsGroupBox.Text = "Rows";
//
// rowTestSpecTextBox2
//
this.rowTestSpecTextBox2.Location = new System.Drawing.Point(326, 52);
this.rowTestSpecTextBox2.Name = "rowTestSpecTextBox2";
this.rowTestSpecTextBox2.Size = new System.Drawing.Size(61, 20);
this.rowTestSpecTextBox2.TabIndex = 5;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(242, 55);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(35, 13);
this.label4.TabIndex = 4;
this.label4.Text = "label4";
//
// rowsComboBox2
//
this.rowsComboBox2.FormattingEnabled = true;
this.rowsComboBox2.Location = new System.Drawing.Point(32, 52);
this.rowsComboBox2.Name = "rowsComboBox2";
this.rowsComboBox2.Size = new System.Drawing.Size(185, 21);
this.rowsComboBox2.TabIndex = 3;
//
// rowTestSpecTextBox
//
this.rowTestSpecTextBox.Location = new System.Drawing.Point(326, 24);
this.rowTestSpecTextBox.Name = "rowTestSpecTextBox";
this.rowTestSpecTextBox.Size = new System.Drawing.Size(61, 20);
this.rowTestSpecTextBox.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(242, 27);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
//
// rowsComboBox
//
this.rowsComboBox.FormattingEnabled = true;
this.rowsComboBox.Location = new System.Drawing.Point(32, 24);
this.rowsComboBox.Name = "rowsComboBox";
this.rowsComboBox.Size = new System.Drawing.Size(185, 21);
this.rowsComboBox.TabIndex = 0;
//
// columnsGroupBox
//
this.columnsGroupBox.Controls.Add(this.columnTestSpecTextBox3);
this.columnsGroupBox.Controls.Add(this.label6);
this.columnsGroupBox.Controls.Add(this.columnsComboBox3);
this.columnsGroupBox.Controls.Add(this.columnTestSpecTextBox2);
this.columnsGroupBox.Controls.Add(this.label3);
this.columnsGroupBox.Controls.Add(this.columnsComboBox2);
this.columnsGroupBox.Controls.Add(this.columnTestSpecTextBox);
this.columnsGroupBox.Controls.Add(this.label2);
this.columnsGroupBox.Controls.Add(this.columnsComboBox);
this.columnsGroupBox.Location = new System.Drawing.Point(38, 175);
this.columnsGroupBox.Name = "columnsGroupBox";
this.columnsGroupBox.Size = new System.Drawing.Size(427, 112);
this.columnsGroupBox.TabIndex = 11;
this.columnsGroupBox.TabStop = false;
this.columnsGroupBox.Text = "Columns";
//
// columnTestSpecTextBox2
//
this.columnTestSpecTextBox2.Location = new System.Drawing.Point(326, 51);
this.columnTestSpecTextBox2.Name = "columnTestSpecTextBox2";
this.columnTestSpecTextBox2.Size = new System.Drawing.Size(61, 20);
this.columnTestSpecTextBox2.TabIndex = 6;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(242, 54);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(35, 13);
this.label3.TabIndex = 5;
this.label3.Text = "label3";
//
// columnsComboBox2
//
this.columnsComboBox2.FormattingEnabled = true;
this.columnsComboBox2.Location = new System.Drawing.Point(32, 51);
this.columnsComboBox2.Name = "columnsComboBox2";
this.columnsComboBox2.Size = new System.Drawing.Size(185, 21);
this.columnsComboBox2.TabIndex = 4;
//
// columnTestSpecTextBox
//
this.columnTestSpecTextBox.Location = new System.Drawing.Point(326, 23);
this.columnTestSpecTextBox.Name = "columnTestSpecTextBox";
this.columnTestSpecTextBox.Size = new System.Drawing.Size(61, 20);
this.columnTestSpecTextBox.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(242, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 13);
this.label2.TabIndex = 2;
this.label2.Text = "label2";
//
// columnsComboBox
//
this.columnsComboBox.FormattingEnabled = true;
this.columnsComboBox.Location = new System.Drawing.Point(32, 23);
this.columnsComboBox.Name = "columnsComboBox";
this.columnsComboBox.Size = new System.Drawing.Size(185, 21);
this.columnsComboBox.TabIndex = 1;
//
// twoDimCheckBox
//
this.twoDimCheckBox.AutoSize = true;
this.twoDimCheckBox.Location = new System.Drawing.Point(39, 21);
this.twoDimCheckBox.Name = "twoDimCheckBox";
this.twoDimCheckBox.Size = new System.Drawing.Size(40, 17);
this.twoDimCheckBox.TabIndex = 12;
this.twoDimCheckBox.Text = "2D";
this.twoDimCheckBox.UseVisualStyleBackColor = true;
this.twoDimCheckBox.CheckedChanged += new System.EventHandler(this.twoDimCheckBox_CheckedChanged);
//
// rowTestSpecTextBox3
//
this.rowTestSpecTextBox3.Location = new System.Drawing.Point(326, 80);
this.rowTestSpecTextBox3.Name = "rowTestSpecTextBox3";
this.rowTestSpecTextBox3.Size = new System.Drawing.Size(61, 20);
this.rowTestSpecTextBox3.TabIndex = 8;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(242, 83);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 13);
this.label5.TabIndex = 7;
this.label5.Text = "label5";
//
// rowsComboBox3
//
this.rowsComboBox3.FormattingEnabled = true;
this.rowsComboBox3.Location = new System.Drawing.Point(32, 80);
this.rowsComboBox3.Name = "rowsComboBox3";
this.rowsComboBox3.Size = new System.Drawing.Size(185, 21);
this.rowsComboBox3.TabIndex = 6;
//
// columnTestSpecTextBox3
//
this.columnTestSpecTextBox3.Location = new System.Drawing.Point(326, 79);
this.columnTestSpecTextBox3.Name = "columnTestSpecTextBox3";
this.columnTestSpecTextBox3.Size = new System.Drawing.Size(61, 20);
this.columnTestSpecTextBox3.TabIndex = 9;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(242, 82);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(35, 13);
this.label6.TabIndex = 8;
this.label6.Text = "label6";
//
// columnsComboBox3
//
this.columnsComboBox3.FormattingEnabled = true;
this.columnsComboBox3.Location = new System.Drawing.Point(32, 79);
this.columnsComboBox3.Name = "columnsComboBox3";
this.columnsComboBox3.Size = new System.Drawing.Size(185, 21);
this.columnsComboBox3.TabIndex = 7;
//
// StatisticsOptionsDlg
//
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.columnsGroupBox);
this.Controls.Add(this.twoDimCheckBox);
this.Controls.Add(this.rowsGroupBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Name = "StatisticsOptionsDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "StatisticsOptionsDlg";
this.Load += new System.EventHandler(this.StatisticsOptionsDlg_Load);
this.rowsGroupBox.ResumeLayout(false);
this.rowsGroupBox.PerformLayout();
this.columnsGroupBox.ResumeLayout(false);
this.columnsGroupBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -185,5 +305,17 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox columnTestSpecTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox columnTestSpecTextBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox columnsComboBox2;
private System.Windows.Forms.TextBox rowTestSpecTextBox2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox rowsComboBox2;
private System.Windows.Forms.TextBox rowTestSpecTextBox3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox rowsComboBox3;
private System.Windows.Forms.TextBox columnTestSpecTextBox3;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox columnsComboBox3;
}
}
+84 -58
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
@@ -12,40 +7,59 @@ namespace ResultsBrowser.Forms
{
public partial class StatisticsOptionsDlg : Form
{
public bool TwoDim;
public int RowItemID;
public int ColumnItemID;
public string RowTestSpecifier;
public string ColumnTestSpecifier;
IList<Results.WMeterRsltItemSpec> items;
public StatisticsOptionsDlg()
public bool TwoDim;
public Results.WMeterRsltItemSpec RowItem;
public Results.WMeterRsltItemSpec RowItem2;
public Results.WMeterRsltItemSpec RowItem3;
public Results.WMeterRsltItemSpec ColumnItem;
public Results.WMeterRsltItemSpec ColumnItem2;
public Results.WMeterRsltItemSpec ColumnItem3;
public string RowTestSpecifier;
public string RowTestSpecifier2;
public string RowTestSpecifier3;
public string ColumnTestSpecifier;
public string ColumnTestSpecifier2;
public string ColumnTestSpecifier3;
public StatisticsOptionsDlg(IList<Results.WMeterRsltItemSpec> items)
{
InitializeComponent();
this.items = items;
}
private void StatisticsOptionsDlg_Load(object sender, EventArgs e)
{
Localize();
twoDimCheckBox.Checked = TwoDim = Program.LocalSettings.TwoDim;
RowItemID = Math.Max(1, Program.LocalSettings.RowItemID);
ColumnItemID = Math.Max(1, Program.LocalSettings.ColumnItemID);
rowTestSpecTextBox.Text = RowTestSpecifier = Program.LocalSettings.RowTestSpecifier;
columnTestSpecTextBox.Text = ColumnTestSpecifier = Program.LocalSettings.ColumnTestSpecifier;
columnsGroupBox.Enabled = twoDimCheckBox.Checked = TwoDim = Program.LocalSettings.TwoDim;
foreach (var item in items)
{
rowsComboBox.Items.Add(item.Caption);
rowsComboBox2.Items.Add(item.Caption);
rowsComboBox3.Items.Add(item.Caption);
columnsComboBox.Items.Add(item.Caption);
columnsComboBox2.Items.Add(item.Caption);
columnsComboBox3.Items.Add(item.Caption);
}
///
rowsComboBox.Text = rowsComboBox.Items.Contains(Program.LocalSettings.RowItemCaption) ? Program.LocalSettings.RowItemCaption : string.Empty;
rowsComboBox2.Text = rowsComboBox2.Items.Contains(Program.LocalSettings.RowItemCaption2) ? Program.LocalSettings.RowItemCaption2 : string.Empty;
rowsComboBox3.Text = rowsComboBox3.Items.Contains(Program.LocalSettings.RowItemCaption3) ? Program.LocalSettings.RowItemCaption3 : string.Empty;
columnsComboBox.Text = columnsComboBox.Items.Contains(Program.LocalSettings.ColumnItemCaption) ? Program.LocalSettings.ColumnItemCaption : string.Empty;
columnsComboBox2.Text = columnsComboBox2.Items.Contains(Program.LocalSettings.ColumnItemCaption2) ? Program.LocalSettings.ColumnItemCaption2 : string.Empty;
columnsComboBox3.Text = columnsComboBox3.Items.Contains(Program.LocalSettings.ColumnItemCaption3) ? Program.LocalSettings.ColumnItemCaption3 : string.Empty;
rowsComboBox.Text = Results.WMeterRsltItemSpec.AllItems[RowItemID].Name; /// TODO: Use Caption
columnsComboBox.Text = Results.WMeterRsltItemSpec.AllItems[ColumnItemID].Name; /// TODO: Use Caption
///
for (int i = 1; i < Results.WMeterRsltItemSpec.AllItems.Count; i++)
{
string item = Results.WMeterRsltItemSpec.AllItems[i].Name; /// TODO: Use Caption
rowsComboBox.Items.Add(item);
columnsComboBox.Items.Add(item);
}
columnsComboBox.Enabled = TwoDim;
}
rowTestSpecTextBox.Text = RowTestSpecifier = Program.LocalSettings.RowTestSpecifier;
rowTestSpecTextBox2.Text = RowTestSpecifier2 = Program.LocalSettings.RowTestSpecifier2;
rowTestSpecTextBox3.Text = RowTestSpecifier3 = Program.LocalSettings.RowTestSpecifier3;
columnTestSpecTextBox.Text = ColumnTestSpecifier = Program.LocalSettings.ColumnTestSpecifier;
columnTestSpecTextBox2.Text = ColumnTestSpecifier2 = Program.LocalSettings.ColumnTestSpecifier2;
columnTestSpecTextBox3.Text = ColumnTestSpecifier3 = Program.LocalSettings.ColumnTestSpecifier3;
}
void Localize()
{
@@ -56,56 +70,68 @@ namespace ResultsBrowser.Forms
columnsGroupBox.Text = Strings.Columns;
label1.Text = Strings.Test;
label2.Text = Strings.Test;
}
label3.Text = Strings.Test;
label4.Text = Strings.Test;
label5.Text = Strings.Test;
label6.Text = Strings.Test;
}
private void twoDimCheckBox_CheckedChanged(object sender, EventArgs e)
{
columnsComboBox.Enabled = twoDimCheckBox.Checked;
columnsGroupBox.Enabled = twoDimCheckBox.Checked;
}
private void okButton_Click(object sender, EventArgs e)
{
TwoDim = twoDimCheckBox.Checked;
RowTestSpecifier = rowTestSpecTextBox.Text;
ColumnTestSpecifier = columnTestSpecTextBox.Text;
RowTestSpecifier2 = rowTestSpecTextBox2.Text;
RowTestSpecifier3 = rowTestSpecTextBox3.Text;
ColumnTestSpecifier = columnTestSpecTextBox.Text;
ColumnTestSpecifier2 = columnTestSpecTextBox2.Text;
ColumnTestSpecifier3 = columnTestSpecTextBox3.Text;
RowItemID = 0;
RowItem = null;
RowItem2 = null;
RowItem3 = null;
ColumnItem = null;
ColumnItem2 = null;
ColumnItem3 = null;
for (int i = 0; i < rowsComboBox.Items.Count; i++)
foreach (var item in items)
{
if (rowsComboBox.Text.Equals(rowsComboBox.Items[i]))
{
RowItemID = i + 1;
break;
}
}
if (!string.IsNullOrEmpty(rowsComboBox.Text) && rowsComboBox.Text.Equals(item.Caption)) RowItem = item;
if (!string.IsNullOrEmpty(rowsComboBox2.Text) && rowsComboBox2.Text.Equals(item.Caption)) RowItem2 = item;
if (!string.IsNullOrEmpty(rowsComboBox3.Text) && rowsComboBox3.Text.Equals(item.Caption)) RowItem3 = item;
if (!string.IsNullOrEmpty(columnsComboBox.Text) && TwoDim && columnsComboBox.Text.Equals(item.Caption)) ColumnItem = item;
if (!string.IsNullOrEmpty(columnsComboBox2.Text) && TwoDim && columnsComboBox2.Text.Equals(item.Caption)) ColumnItem2 = item;
if (!string.IsNullOrEmpty(columnsComboBox3.Text) && TwoDim && columnsComboBox3.Text.Equals(item.Caption)) ColumnItem3 = item;
}
if (TwoDim)
{
ColumnItemID = 0;
for (int i = 0; i < columnsComboBox.Items.Count; i++)
{
if (columnsComboBox.Text.Equals(columnsComboBox.Items[i]))
{
ColumnItemID = i + 1;
break;
}
}
}
if (RowItemID == 0 || ColumnItemID == 0)
if (RowItem == null || (TwoDim && ColumnItem == null))
{
MessageBox.Show(Strings.Error, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
DialogResult = DialogResult.Cancel;
Close();
return;
}
Program.LocalSettings.TwoDim = TwoDim;
Program.LocalSettings.RowItemID = RowItemID;
Program.LocalSettings.ColumnItemID = ColumnItemID;
Program.LocalSettings.RowTestSpecifier = RowTestSpecifier;
Program.LocalSettings.ColumnTestSpecifier = ColumnTestSpecifier;
Program.LocalSettings.Save();
Program.LocalSettings.RowItemCaption = RowItem.Caption;
Program.LocalSettings.RowItemCaption2 = (RowItem2 != null) ? RowItem2.Caption : string.Empty;
Program.LocalSettings.RowItemCaption3 = (RowItem3 != null) ? RowItem3.Caption : string.Empty;
Program.LocalSettings.ColumnItemCaption = (ColumnItem != null) ? ColumnItem.Caption : string.Empty;
Program.LocalSettings.ColumnItemCaption2 = (ColumnItem2 != null) ? ColumnItem2.Caption : string.Empty;
Program.LocalSettings.ColumnItemCaption3 = (ColumnItem3 != null) ? ColumnItem3.Caption : string.Empty;
Program.LocalSettings.RowTestSpecifier = RowTestSpecifier;
Program.LocalSettings.RowTestSpecifier2 = RowTestSpecifier2;
Program.LocalSettings.RowTestSpecifier3 = RowTestSpecifier3;
Program.LocalSettings.ColumnTestSpecifier = ColumnTestSpecifier;
Program.LocalSettings.ColumnTestSpecifier2 = ColumnTestSpecifier2;
Program.LocalSettings.ColumnTestSpecifier3 = ColumnTestSpecifier3;
Program.LocalSettings.Save();
DialogResult = DialogResult.OK;
Close();
+17 -4
View File
@@ -37,12 +37,22 @@ namespace ResultsBrowser
public bool Bench2Selected;
public bool Bench3Selected;
public string TimePeriodFormat;
/// Statistics options
public bool TwoDim;
public int RowItemID;
public int ColumnItemID;
public string RowTestSpecifier;
public string ColumnTestSpecifier;
public string RowItemCaption;
public string RowItemCaption2;
public string RowItemCaption3;
public string ColumnItemCaption;
public string ColumnItemCaption2;
public string ColumnItemCaption3;
public string RowTestSpecifier;
public string RowTestSpecifier2;
public string RowTestSpecifier3;
public string ColumnTestSpecifier;
public string ColumnTestSpecifier2;
public string ColumnTestSpecifier3;
public bool FilterPurchaseOrder;
@@ -59,6 +69,9 @@ namespace ResultsBrowser
public bool ManiWndMaximized;
public int SplitterDistance;
/// Last configuration file name
public string LastConfigFileName;
/// Purchase order history
public string LastPurchaseOrder;
public string[] PurchaseOrderHistory;
-590
View File
@@ -1,590 +0,0 @@
namespace ResultsBrowser
{
partial class MainWnd
{
/// <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.queryBatchesButton = new System.Windows.Forms.Button();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.queryWatermetersButton = new System.Windows.Forms.Button();
this.batchNrGroupBox = new System.Windows.Forms.GroupBox();
this.batchNrToTextBox = new System.Windows.Forms.TextBox();
this.batchNrFromTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.batchNrCheckBox = new System.Windows.Forms.CheckBox();
this.removeFromQueryButton = new System.Windows.Forms.Button();
this.addToReportButton = new System.Windows.Forms.Button();
this.resolveManuallyCheckBox = new System.Windows.Forms.CheckBox();
this.procedureGroupBox = new System.Windows.Forms.GroupBox();
this.procedureCheckBox = new System.Windows.Forms.CheckBox();
this.procedureComboBox = new System.Windows.Forms.ComboBox();
this.fromGroupBox = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.filterDateCheckBox = new System.Windows.Forms.CheckBox();
this.toDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.purchaseOrderGroupBox = new System.Windows.Forms.GroupBox();
this.purchaseOrderCheckBox = new System.Windows.Forms.CheckBox();
this.purchaseOrderComboBox = new System.Windows.Forms.ComboBox();
this.queryResultsListBox = new System.Windows.Forms.ListBox();
this.configReportButton = new System.Windows.Forms.Button();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.configButton = new System.Windows.Forms.Button();
this.makeReportButton = new System.Windows.Forms.Button();
this.removeFromReportButton = new System.Windows.Forms.Button();
this.reportFileGroupBox = new System.Windows.Forms.GroupBox();
this.browseFileButton = new System.Windows.Forms.Button();
this.reportFileComboBox = new System.Windows.Forms.ComboBox();
this.makeAscFileButton = new System.Windows.Forms.Button();
this.addOracleDataButton = new System.Windows.Forms.Button();
this.reportListBox = new System.Windows.Forms.ListBox();
this.queryResultsItemsLabel = new System.Windows.Forms.Label();
this.reportItemsLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.batchNrGroupBox.SuspendLayout();
this.procedureGroupBox.SuspendLayout();
this.fromGroupBox.SuspendLayout();
this.purchaseOrderGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.reportFileGroupBox.SuspendLayout();
this.SuspendLayout();
//
// queryBatchesButton
//
this.queryBatchesButton.Location = new System.Drawing.Point(15, 178);
this.queryBatchesButton.Name = "queryBatchesButton";
this.queryBatchesButton.Size = new System.Drawing.Size(108, 29);
this.queryBatchesButton.TabIndex = 3;
this.queryBatchesButton.Text = "Query batches";
this.queryBatchesButton.UseVisualStyleBackColor = true;
this.queryBatchesButton.Click += new System.EventHandler(this.queryBatchesButton_Click);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.queryResultsItemsLabel);
this.splitContainer1.Panel1.Controls.Add(this.queryWatermetersButton);
this.splitContainer1.Panel1.Controls.Add(this.batchNrGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.removeFromQueryButton);
this.splitContainer1.Panel1.Controls.Add(this.addToReportButton);
this.splitContainer1.Panel1.Controls.Add(this.resolveManuallyCheckBox);
this.splitContainer1.Panel1.Controls.Add(this.procedureGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.fromGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.queryBatchesButton);
this.splitContainer1.Panel1.Controls.Add(this.purchaseOrderGroupBox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.queryResultsListBox);
this.splitContainer1.Size = new System.Drawing.Size(604, 624);
this.splitContainer1.SplitterDistance = 220;
this.splitContainer1.TabIndex = 5;
//
// queryWatermetersButton
//
this.queryWatermetersButton.Location = new System.Drawing.Point(129, 178);
this.queryWatermetersButton.Name = "queryWatermetersButton";
this.queryWatermetersButton.Size = new System.Drawing.Size(108, 29);
this.queryWatermetersButton.TabIndex = 12;
this.queryWatermetersButton.Text = "Query water meters";
this.queryWatermetersButton.UseVisualStyleBackColor = true;
this.queryWatermetersButton.Click += new System.EventHandler(this.queryWatermetersButton_Click);
//
// batchNrGroupBox
//
this.batchNrGroupBox.Controls.Add(this.batchNrToTextBox);
this.batchNrGroupBox.Controls.Add(this.batchNrFromTextBox);
this.batchNrGroupBox.Controls.Add(this.label4);
this.batchNrGroupBox.Controls.Add(this.label3);
this.batchNrGroupBox.Controls.Add(this.batchNrCheckBox);
this.batchNrGroupBox.Location = new System.Drawing.Point(15, 122);
this.batchNrGroupBox.Name = "batchNrGroupBox";
this.batchNrGroupBox.Size = new System.Drawing.Size(242, 50);
this.batchNrGroupBox.TabIndex = 11;
this.batchNrGroupBox.TabStop = false;
this.batchNrGroupBox.Visible = false;
//
// batchNrToTextBox
//
this.batchNrToTextBox.Location = new System.Drawing.Point(157, 21);
this.batchNrToTextBox.Name = "batchNrToTextBox";
this.batchNrToTextBox.Size = new System.Drawing.Size(62, 20);
this.batchNrToTextBox.TabIndex = 5;
//
// batchNrFromTextBox
//
this.batchNrFromTextBox.Location = new System.Drawing.Point(56, 21);
this.batchNrFromTextBox.Name = "batchNrFromTextBox";
this.batchNrFromTextBox.Size = new System.Drawing.Size(62, 20);
this.batchNrFromTextBox.TabIndex = 4;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(131, 24);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(20, 13);
this.label4.TabIndex = 3;
this.label4.Text = "To";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(19, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(30, 13);
this.label3.TabIndex = 2;
this.label3.Text = "From";
//
// batchNrCheckBox
//
this.batchNrCheckBox.AutoSize = true;
this.batchNrCheckBox.Location = new System.Drawing.Point(19, 0);
this.batchNrCheckBox.Name = "batchNrCheckBox";
this.batchNrCheckBox.Size = new System.Drawing.Size(116, 17);
this.batchNrCheckBox.TabIndex = 1;
this.batchNrCheckBox.Text = "Filter batch number";
this.batchNrCheckBox.UseVisualStyleBackColor = true;
this.batchNrCheckBox.Visible = false;
//
// removeFromQueryButton
//
this.removeFromQueryButton.Location = new System.Drawing.Point(380, 178);
this.removeFromQueryButton.Name = "removeFromQueryButton";
this.removeFromQueryButton.Size = new System.Drawing.Size(114, 29);
this.removeFromQueryButton.TabIndex = 9;
this.removeFromQueryButton.Text = "Remove selected";
this.removeFromQueryButton.UseVisualStyleBackColor = true;
this.removeFromQueryButton.Click += new System.EventHandler(this.removeFromQueryButton_Click);
//
// addToReportButton
//
this.addToReportButton.Location = new System.Drawing.Point(558, 162);
this.addToReportButton.Name = "addToReportButton";
this.addToReportButton.Size = new System.Drawing.Size(46, 40);
this.addToReportButton.TabIndex = 8;
this.addToReportButton.Text = ">>>";
this.addToReportButton.UseVisualStyleBackColor = true;
this.addToReportButton.Click += new System.EventHandler(this.addToReportButton_Click);
//
// resolveManuallyCheckBox
//
this.resolveManuallyCheckBox.AutoSize = true;
this.resolveManuallyCheckBox.Location = new System.Drawing.Point(282, 143);
this.resolveManuallyCheckBox.Name = "resolveManuallyCheckBox";
this.resolveManuallyCheckBox.Size = new System.Drawing.Size(158, 17);
this.resolveManuallyCheckBox.TabIndex = 7;
this.resolveManuallyCheckBox.Text = "Resolve duplicities manually";
this.resolveManuallyCheckBox.UseVisualStyleBackColor = true;
//
// procedureGroupBox
//
this.procedureGroupBox.Controls.Add(this.procedureCheckBox);
this.procedureGroupBox.Controls.Add(this.procedureComboBox);
this.procedureGroupBox.Location = new System.Drawing.Point(15, 68);
this.procedureGroupBox.Name = "procedureGroupBox";
this.procedureGroupBox.Size = new System.Drawing.Size(242, 50);
this.procedureGroupBox.TabIndex = 6;
this.procedureGroupBox.TabStop = false;
//
// procedureCheckBox
//
this.procedureCheckBox.AutoSize = true;
this.procedureCheckBox.Location = new System.Drawing.Point(19, 0);
this.procedureCheckBox.Name = "procedureCheckBox";
this.procedureCheckBox.Size = new System.Drawing.Size(99, 17);
this.procedureCheckBox.TabIndex = 1;
this.procedureCheckBox.Text = "Filter procedure";
this.procedureCheckBox.UseVisualStyleBackColor = true;
this.procedureCheckBox.CheckedChanged += new System.EventHandler(this.procedureCheckBox_CheckedChanged);
//
// procedureComboBox
//
this.procedureComboBox.FormattingEnabled = true;
this.procedureComboBox.Location = new System.Drawing.Point(18, 19);
this.procedureComboBox.Name = "procedureComboBox";
this.procedureComboBox.Size = new System.Drawing.Size(201, 21);
this.procedureComboBox.TabIndex = 0;
//
// fromGroupBox
//
this.fromGroupBox.Controls.Add(this.label2);
this.fromGroupBox.Controls.Add(this.label1);
this.fromGroupBox.Controls.Add(this.filterDateCheckBox);
this.fromGroupBox.Controls.Add(this.toDateTimePicker);
this.fromGroupBox.Controls.Add(this.fromDateTimePicker);
this.fromGroupBox.Location = new System.Drawing.Point(263, 14);
this.fromGroupBox.Name = "fromGroupBox";
this.fromGroupBox.Size = new System.Drawing.Size(242, 104);
this.fromGroupBox.TabIndex = 3;
this.fromGroupBox.TabStop = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 68);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(20, 13);
this.label2.TabIndex = 3;
this.label2.Text = "To";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(30, 13);
this.label1.TabIndex = 2;
this.label1.Text = "From";
//
// filterDateCheckBox
//
this.filterDateCheckBox.AutoSize = true;
this.filterDateCheckBox.Location = new System.Drawing.Point(19, -1);
this.filterDateCheckBox.Name = "filterDateCheckBox";
this.filterDateCheckBox.Size = new System.Drawing.Size(72, 17);
this.filterDateCheckBox.TabIndex = 1;
this.filterDateCheckBox.Text = "Filter date";
this.filterDateCheckBox.UseVisualStyleBackColor = true;
//
// toDateTimePicker
//
this.toDateTimePicker.Location = new System.Drawing.Point(68, 65);
this.toDateTimePicker.Name = "toDateTimePicker";
this.toDateTimePicker.Size = new System.Drawing.Size(151, 20);
this.toDateTimePicker.TabIndex = 0;
//
// fromDateTimePicker
//
this.fromDateTimePicker.Location = new System.Drawing.Point(68, 32);
this.fromDateTimePicker.Name = "fromDateTimePicker";
this.fromDateTimePicker.Size = new System.Drawing.Size(151, 20);
this.fromDateTimePicker.TabIndex = 0;
//
// purchaseOrderGroupBox
//
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderCheckBox);
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderComboBox);
this.purchaseOrderGroupBox.Location = new System.Drawing.Point(15, 14);
this.purchaseOrderGroupBox.Name = "purchaseOrderGroupBox";
this.purchaseOrderGroupBox.Size = new System.Drawing.Size(242, 50);
this.purchaseOrderGroupBox.TabIndex = 2;
this.purchaseOrderGroupBox.TabStop = false;
//
// purchaseOrderCheckBox
//
this.purchaseOrderCheckBox.AutoSize = true;
this.purchaseOrderCheckBox.Location = new System.Drawing.Point(19, 0);
this.purchaseOrderCheckBox.Name = "purchaseOrderCheckBox";
this.purchaseOrderCheckBox.Size = new System.Drawing.Size(122, 17);
this.purchaseOrderCheckBox.TabIndex = 1;
this.purchaseOrderCheckBox.Text = "Filter purchase order";
this.purchaseOrderCheckBox.UseVisualStyleBackColor = true;
//
// purchaseOrderComboBox
//
this.purchaseOrderComboBox.FormattingEnabled = true;
this.purchaseOrderComboBox.Location = new System.Drawing.Point(18, 19);
this.purchaseOrderComboBox.Name = "purchaseOrderComboBox";
this.purchaseOrderComboBox.Size = new System.Drawing.Size(201, 21);
this.purchaseOrderComboBox.TabIndex = 0;
//
// queryResultsListBox
//
this.queryResultsListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.queryResultsListBox.FormattingEnabled = true;
this.queryResultsListBox.Location = new System.Drawing.Point(0, 0);
this.queryResultsListBox.Name = "queryResultsListBox";
this.queryResultsListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
this.queryResultsListBox.Size = new System.Drawing.Size(604, 400);
this.queryResultsListBox.TabIndex = 0;
this.queryResultsListBox.DoubleClick += new System.EventHandler(this.queryResultsListBox_DoubleClick);
//
// configReportButton
//
this.configReportButton.Location = new System.Drawing.Point(226, 95);
this.configReportButton.Name = "configReportButton";
this.configReportButton.Size = new System.Drawing.Size(103, 47);
this.configReportButton.TabIndex = 5;
this.configReportButton.Text = "Configure Report";
this.configReportButton.UseVisualStyleBackColor = true;
this.configReportButton.Click += new System.EventHandler(this.configReportButton_Click);
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(1284, 624);
this.splitContainer2.SplitterDistance = 604;
this.splitContainer2.TabIndex = 6;
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.reportItemsLabel);
this.splitContainer3.Panel1.Controls.Add(this.configButton);
this.splitContainer3.Panel1.Controls.Add(this.makeReportButton);
this.splitContainer3.Panel1.Controls.Add(this.removeFromReportButton);
this.splitContainer3.Panel1.Controls.Add(this.reportFileGroupBox);
this.splitContainer3.Panel1.Controls.Add(this.makeAscFileButton);
this.splitContainer3.Panel1.Controls.Add(this.addOracleDataButton);
this.splitContainer3.Panel1.Controls.Add(this.configReportButton);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.reportListBox);
this.splitContainer3.Size = new System.Drawing.Size(676, 624);
this.splitContainer3.SplitterDistance = 220;
this.splitContainer3.TabIndex = 6;
//
// configButton
//
this.configButton.Location = new System.Drawing.Point(589, 14);
this.configButton.Name = "configButton";
this.configButton.Size = new System.Drawing.Size(75, 71);
this.configButton.TabIndex = 12;
this.configButton.Text = "Configure";
this.configButton.UseVisualStyleBackColor = true;
this.configButton.Click += new System.EventHandler(this.configButton_Click);
//
// makeReportButton
//
this.makeReportButton.Location = new System.Drawing.Point(335, 95);
this.makeReportButton.Name = "makeReportButton";
this.makeReportButton.Size = new System.Drawing.Size(103, 47);
this.makeReportButton.TabIndex = 11;
this.makeReportButton.Text = "Make Report";
this.makeReportButton.UseVisualStyleBackColor = true;
this.makeReportButton.Click += new System.EventHandler(this.makeReportButton_Click);
//
// removeFromReportButton
//
this.removeFromReportButton.Location = new System.Drawing.Point(55, 178);
this.removeFromReportButton.Name = "removeFromReportButton";
this.removeFromReportButton.Size = new System.Drawing.Size(114, 29);
this.removeFromReportButton.TabIndex = 10;
this.removeFromReportButton.Text = "Remove selected";
this.removeFromReportButton.UseVisualStyleBackColor = true;
this.removeFromReportButton.Click += new System.EventHandler(this.removeFromReportButton_Click);
//
// reportFileGroupBox
//
this.reportFileGroupBox.Controls.Add(this.browseFileButton);
this.reportFileGroupBox.Controls.Add(this.reportFileComboBox);
this.reportFileGroupBox.Location = new System.Drawing.Point(18, 14);
this.reportFileGroupBox.Name = "reportFileGroupBox";
this.reportFileGroupBox.Size = new System.Drawing.Size(546, 63);
this.reportFileGroupBox.TabIndex = 8;
this.reportFileGroupBox.TabStop = false;
this.reportFileGroupBox.Text = "Report file name";
//
// browseFileButton
//
this.browseFileButton.Location = new System.Drawing.Point(453, 22);
this.browseFileButton.Name = "browseFileButton";
this.browseFileButton.Size = new System.Drawing.Size(75, 27);
this.browseFileButton.TabIndex = 2;
this.browseFileButton.Text = "Browse";
this.browseFileButton.UseVisualStyleBackColor = true;
this.browseFileButton.Click += new System.EventHandler(this.browseFileButton_Click);
//
// reportFileComboBox
//
this.reportFileComboBox.FormattingEnabled = true;
this.reportFileComboBox.Location = new System.Drawing.Point(20, 25);
this.reportFileComboBox.Name = "reportFileComboBox";
this.reportFileComboBox.Size = new System.Drawing.Size(414, 21);
this.reportFileComboBox.TabIndex = 1;
//
// makeAscFileButton
//
this.makeAscFileButton.Location = new System.Drawing.Point(443, 95);
this.makeAscFileButton.Name = "makeAscFileButton";
this.makeAscFileButton.Size = new System.Drawing.Size(103, 47);
this.makeAscFileButton.TabIndex = 7;
this.makeAscFileButton.Text = "Make *.asc File";
this.makeAscFileButton.UseVisualStyleBackColor = true;
this.makeAscFileButton.Click += new System.EventHandler(this.makeAscFileButton_Click);
//
// addOracleDataButton
//
this.addOracleDataButton.Location = new System.Drawing.Point(117, 95);
this.addOracleDataButton.Name = "addOracleDataButton";
this.addOracleDataButton.Size = new System.Drawing.Size(103, 47);
this.addOracleDataButton.TabIndex = 6;
this.addOracleDataButton.Text = "Add Oracle Data";
this.addOracleDataButton.UseVisualStyleBackColor = true;
this.addOracleDataButton.Click += new System.EventHandler(this.addOracleDataButton_Click);
//
// reportListBox
//
this.reportListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.reportListBox.FormattingEnabled = true;
this.reportListBox.Location = new System.Drawing.Point(0, 0);
this.reportListBox.Name = "reportListBox";
this.reportListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
this.reportListBox.Size = new System.Drawing.Size(676, 400);
this.reportListBox.TabIndex = 0;
this.reportListBox.DoubleClick += new System.EventHandler(this.reportListBox_DoubleClick);
//
// queryResultsItemsLabel
//
this.queryResultsItemsLabel.AutoSize = true;
this.queryResultsItemsLabel.Location = new System.Drawing.Point(255, 207);
this.queryResultsItemsLabel.Name = "queryResultsItemsLabel";
this.queryResultsItemsLabel.Size = new System.Drawing.Size(40, 13);
this.queryResultsItemsLabel.TabIndex = 13;
this.queryResultsItemsLabel.Text = "0 items";
//
// reportItemsLabel
//
this.reportItemsLabel.AutoSize = true;
this.reportItemsLabel.Location = new System.Drawing.Point(261, 207);
this.reportItemsLabel.Name = "reportItemsLabel";
this.reportItemsLabel.Size = new System.Drawing.Size(40, 13);
this.reportItemsLabel.TabIndex = 14;
this.reportItemsLabel.Text = "0 items";
//
// MainWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1284, 624);
this.Controls.Add(this.splitContainer2);
this.Name = "MainWnd";
this.Text = "Results browser";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWnd_FormClosing);
this.Load += new System.EventHandler(this.MainWnd_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.batchNrGroupBox.ResumeLayout(false);
this.batchNrGroupBox.PerformLayout();
this.procedureGroupBox.ResumeLayout(false);
this.procedureGroupBox.PerformLayout();
this.fromGroupBox.ResumeLayout(false);
this.fromGroupBox.PerformLayout();
this.purchaseOrderGroupBox.ResumeLayout(false);
this.purchaseOrderGroupBox.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.reportFileGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button queryBatchesButton;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.GroupBox fromGroupBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox filterDateCheckBox;
private System.Windows.Forms.DateTimePicker toDateTimePicker;
private System.Windows.Forms.DateTimePicker fromDateTimePicker;
private System.Windows.Forms.GroupBox purchaseOrderGroupBox;
private System.Windows.Forms.CheckBox purchaseOrderCheckBox;
private System.Windows.Forms.ComboBox purchaseOrderComboBox;
private System.Windows.Forms.Button configReportButton;
private System.Windows.Forms.CheckBox resolveManuallyCheckBox;
private System.Windows.Forms.GroupBox procedureGroupBox;
private System.Windows.Forms.CheckBox procedureCheckBox;
private System.Windows.Forms.ComboBox procedureComboBox;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Button addOracleDataButton;
private System.Windows.Forms.Button makeAscFileButton;
private System.Windows.Forms.ListBox queryResultsListBox;
private System.Windows.Forms.ListBox reportListBox;
private System.Windows.Forms.GroupBox reportFileGroupBox;
private System.Windows.Forms.Button browseFileButton;
private System.Windows.Forms.ComboBox reportFileComboBox;
private System.Windows.Forms.Button removeFromQueryButton;
private System.Windows.Forms.Button addToReportButton;
private System.Windows.Forms.Button removeFromReportButton;
private System.Windows.Forms.GroupBox batchNrGroupBox;
private System.Windows.Forms.TextBox batchNrToTextBox;
private System.Windows.Forms.TextBox batchNrFromTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox batchNrCheckBox;
private System.Windows.Forms.Button makeReportButton;
private System.Windows.Forms.Button configButton;
private System.Windows.Forms.Button queryWatermetersButton;
private System.Windows.Forms.Label queryResultsItemsLabel;
private System.Windows.Forms.Label reportItemsLabel;
}
}
-590
View File
@@ -1,590 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using log4net;
using NHibernate;
using Oracle.DataAccess.Client; // ODP.NET Oracle managed provider
using Oracle.DataAccess.Types;
using Results.Entities;
namespace ResultsBrowser
{
public partial class MainWnd : Form
{
static readonly ILog log = LogManager.GetLogger(typeof(MainWnd));
bool batchesQueried;
public static IList<Batch> QueryBatches;
public static IList<WaterMeter> QueryWaterMeters;
public static IList<Batch> ReportBatches;
public static IList<WaterMeter> ReportWaterMeters;
public IList<Results.ItemSpec> ReportItems_Single;
public IList<Results.ItemSpec> ReportItems_Compound;
public MainWnd()
{
InitializeComponent();
QueryBatches = new List<Batch>();
QueryWaterMeters = new List<WaterMeter>();
ReportBatches = new List<Batch>();
ReportWaterMeters = new List<WaterMeter>();
}
private void MainWnd_Load(object sender, EventArgs e)
{
PrepareComboBoxHistory(Program.LocalSettings.PurchaseOrderHistory, purchaseOrderComboBox);
PrepareComboBoxHistory(Program.LocalSettings.ProcedureHistory, procedureComboBox);
PrepareComboBoxHistory(Program.LocalSettings.ReportFileNameHistory, reportFileComboBox);
purchaseOrderComboBox.Text = Program.LocalSettings.LastPurchaseOrder;
procedureComboBox.Text = Program.LocalSettings.LastProcedure;
reportFileComboBox.Text = Program.LocalSettings.LastReportFileName;
ReportItems_Single = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Single);
ReportItems_Compound = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Compound);
purchaseOrderCheckBox.Checked = Program.LocalSettings.FilterPurchaseOrder;
procedureCheckBox.Checked = Program.LocalSettings.FilterProcedure;
batchNrCheckBox.Checked = Program.LocalSettings.FilterBatchNr;
filterDateCheckBox.Checked = Program.LocalSettings.FilterDate;
resolveManuallyCheckBox.Checked = Program.LocalSettings.ResolveManually;
batchNrFromTextBox.Text = Program.LocalSettings.BatchFrom;
batchNrToTextBox.Text = Program.LocalSettings.BatchTo;
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString1;
}
private void MainWnd_FormClosing(object sender, FormClosingEventArgs e)
{
Program.LocalSettings.UpdateHistory(purchaseOrderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(procedureComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(reportFileComboBox.Text, ref Program.LocalSettings.ReportFileNameHistory);
Program.LocalSettings.LastPurchaseOrder = purchaseOrderComboBox.Text;
Program.LocalSettings.LastProcedure = procedureComboBox.Text;
Program.LocalSettings.LastReportFileName = reportFileComboBox.Text;
Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single);
Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound);
Program.LocalSettings.FilterPurchaseOrder = purchaseOrderCheckBox.Checked;
Program.LocalSettings.FilterProcedure = procedureCheckBox.Checked;
Program.LocalSettings.FilterBatchNr = batchNrCheckBox.Checked;
Program.LocalSettings.FilterDate = filterDateCheckBox.Checked;
Program.LocalSettings.BatchFrom = batchNrFromTextBox.Text;
Program.LocalSettings.BatchTo = batchNrToTextBox.Text;
Program.LocalSettings.ResolveManually = resolveManuallyCheckBox.Checked;
Program.LocalSettings.Save();
}
void RedrawLists()
{
RedrawQueryList();
RedrawReportList();
}
void RedrawQueryList()
{
queryResultsListBox.Items.Clear();
if (batchesQueried)
{
foreach (var b in QueryBatches) queryResultsListBox.Items.Add(b.ToString());
}
else
{
foreach (var wmr in QueryWaterMeters) queryResultsListBox.Items.Add(wmr);
}
int nrItems = queryResultsListBox.Items.Count;
if (nrItems == 0) queryResultsListBox.Items.Add("<empty>");
queryResultsItemsLabel.Text = string.Format("{0} items", nrItems);
}
void RedrawReportList()
{
reportListBox.Items.Clear();
foreach (var wmr in ReportWaterMeters) reportListBox.Items.Add(wmr);
int nrItems = reportListBox.Items.Count;
if (nrItems == 0) reportListBox.Items.Add("<empty>");
reportItemsLabel.Text = string.Format("{0} items", nrItems);
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="comboBox">Puchase order ComboBox</param>
void PrepareComboBoxHistory(string[] history, ComboBox comboBox)
{
if (history == null || history.Length == 0) return;
for (int i = 0; i < history.Length; i++) comboBox.Items.Add(history[i]);
if (comboBox.Items.Count > 0) comboBox.Text = comboBox.Items[0].ToString();
}
private void filterDateCheckBox_CheckedChanged(object sender, EventArgs e)
{
fromDateTimePicker.Enabled = toDateTimePicker.Enabled = filterDateCheckBox.Checked;
}
private void purchaseOrderCheckBox_CheckedChanged(object sender, EventArgs e)
{
purchaseOrderComboBox.Enabled = purchaseOrderCheckBox.Checked;
}
private void procedureCheckBox_CheckedChanged(object sender, EventArgs e)
{
procedureComboBox.Enabled = procedureCheckBox.Checked;
}
private void clearButton_Click(object sender, EventArgs e)
{
QueryWaterMeters.Clear();
queryResultsListBox.Items.Clear();
}
private void configReportButton_Click(object sender, EventArgs e)
{
Forms.ResultsConfig dlg = new Forms.ResultsConfig(false);
dlg.ReportItems_Single = ReportItems_Single;
dlg.ReportItems_Compound = ReportItems_Compound;
if (DialogResult.OK == dlg.ShowDialog())
{
ReportItems_Single = dlg.ReportItems_Single;
ReportItems_Compound = dlg.ReportItems_Compound;
Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single);
Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound);
}
}
private void removeFromQueryButton_Click(object sender, EventArgs e)
{
try
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = queryResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
if (batchesQueried)
{
QueryBatches.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
else
{
QueryWaterMeters.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
}
RedrawLists();
}
catch
{
MessageBox.Show("Something strange happened", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void removeFromReportButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = reportListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
ReportWaterMeters.RemoveAt(reportListBox.SelectedIndices[i]);
}
RedrawLists();
}
private void addToReportButton_Click(object sender, EventArgs e)
{
if (batchesQueried)
{
foreach (var b in QueryBatches)
{
foreach (var wm in b.WaterMeters) ReportWaterMeters.Add(wm);
}
}
else
{
foreach (var wm in QueryWaterMeters)
{
if (!ReportWaterMeters.Contains(wm)) ReportWaterMeters.Add(wm);
}
}
RedrawLists();
}
private void browseFileButton_Click(object sender, EventArgs e)
{
SaveFileDialog dlg = new SaveFileDialog();
dlg.Title = "Target file";
if (dlg.ShowDialog() == DialogResult.OK)
{
reportFileComboBox.Text = dlg.FileName;
}
}
private void addOracleDataButton_Click(object sender, EventArgs e)
{
#if IPERLST || IPERLST_SPECIAL
if (ReportWaterMeters.Count == 0) return;
/// Oracle database connection
OracleConnection conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
try
{
conn.Open();
for (int i = 0; i < ReportWaterMeters.Count; i++)
{
Results.Entities.WaterMeter wm = ReportWaterMeters[i];
IList<int> serialNrExes = new List<int>();
{
OracleParameter parm = new OracleParameter();
parm.OracleDbType = OracleDbType.Varchar2;
parm.Value = wm.SerialNr; /// PCB Nr.
OracleCommand cmd1 = new OracleCommand("SELECT Zaehlernummer, Auftragsnummer FROM VT_ZAEHLER_PD WHERE VT_Fernum = :1 AND ANBID = 4", conn);
cmd1.Parameters.Add(parm);
OracleDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
wm.SerialNrEx = dr.GetInt32(0);
wm.PurchaseOrder = dr.GetString(1);
}
dr.Close();
}
}
conn.Close();
}
catch (Exception exc)
{
MessageBox.Show(string.Format("Error when querying Oracle database:\r\n{0}", exc.Message),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
RedrawLists();
return;
}
RedrawLists();
#endif
}
/// <summary>
/// Create ASC file in R.Uhlik format
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void makeAscFileButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(reportFileComboBox.Text))
{
MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (ReportItems_Single == null || ReportItems_Single.Count == 0)
{
MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true))
{
foreach (var wm in ReportWaterMeters)
{
try
{
StringBuilder sb = new StringBuilder();
#if IPERLST || IPERLST_SPECIAL
sb.Append(wm.SerialNrEx);
#else
sb.Append(wm.SerialNr);
#endif
sb.Append(';'); sb.Append(wm.ProductName());
sb.Append(';'); sb.Append(wm.ApprovalInfo());
sb.Append(';'); sb.Append(wm.MetrologicalClass());
sb.Append(';'); sb.Append("0");
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q1") != null ? wm.GetTestRslt("Q1").Qfrom() : 0)).ToString("F0")); /// Q1 nominal
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q2") != null ? wm.GetTestRslt("Q2").Qfrom() : 0)).ToString("F0")); /// Q2 nominal
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q3") != null ? wm.GetTestRslt("Q3").Qto() : 0)).ToString("F0")); /// Q3 nominal
sb.Append(';'); sb.Append("0"); /// Q4 nominal
sb.Append(';'); sb.Append("6"); /// Worker code
sb.Append(';'); sb.Append(ToShortStr(wm.EndTime()));
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q1") != null ? wm.GetMeterTestRslt("Q1").Error : 99).ToString("F1")); /// Q1 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q2") != null ? wm.GetMeterTestRslt("Q2").Error : 99).ToString("F1")); /// Q2 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q3") != null ? wm.GetMeterTestRslt("Q3").Error : 99).ToString("F1")); /// Q3 Error [%]
sb.Append(';'); sb.Append("0"); /// Q4 Error [%]
sb.Append(';'); sb.Append(wm.BenchId().ToString()); ///
sb.Append(';'); sb.Append(wm.PurchaseOrder);
sb.Append(';'); sb.Append("");
sb.Append(';'); sb.Append("10000");
sb.Append(';'); sb.Append(wm.ProcedureName().Substring(0, 8));
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"');
report.WriteLine(sb);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
static string ToShortStr(DateTime date)
{
return (((date.Year % 100) * 100 + date.Month) * 100 + date.Day).ToString();
}
private void makeReportButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(reportFileComboBox.Text))
{
MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (ReportItems_Single == null || ReportItems_Single.Count == 0)
{
MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true))
{
foreach (var wm in ReportWaterMeters)
{
try
{
StringBuilder sb = new StringBuilder();
#if IPERLST || IPERLST_SPECIAL
sb.Append(wm.SerialNrEx);
#else
sb.Append(wm.SerialNr);
#endif
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"'); /// PCB number
sb.Append(";\""); sb.Append(wm.ProcedureName()); sb.Append('"'); /// Procedure name
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("q3") != null ? wm.GetTestRslt("q3").Qto() : 0)).ToString("F0")); /// Q3 nominal
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("adjustment") != null ? wm.GetMeterTestRslt("adjustment").Error : 99).ToString("F2"));/// Adjustment Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q3") != null ? wm.GetMeterTestRslt("q1").Error : 99).ToString("F2")); /// Q1 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q2") != null ? wm.GetMeterTestRslt("q2").Error : 99).ToString("F2")); /// Q2 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q1") != null ? wm.GetMeterTestRslt("q3").Error : 99).ToString("F2")); /// Q3 Error [%]
sb.Append(';'); sb.Append(wm.StartTime().ToShortTimeString());
sb.Append(';'); sb.Append(wm.EndTime().ToShortTimeString());
report.WriteLine(sb);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void configButton_Click(object sender, EventArgs e)
{
if ((new Forms.DatabaseSettingsDlg()).ShowDialog() == DialogResult.OK)
{
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString1;
}
}
private void queryBatchesButton_Click(object sender, EventArgs e)
{
if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked &&
!filterDateCheckBox.Checked && !batchNrCheckBox.Checked)
{
return;
}
queryResultsListBox.Items.Clear();
try
{
ISession session = Results.DB.CreateSession();
IList<Batch> batches;
if (filterDateCheckBox.Checked)
{
batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.EndTime)
.IsBetween(fromDateTimePicker.Value.Date)
.And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1))
//.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
}
else
{
batches = session.QueryOver<Batch>()
.List<Batch>();
}
if (procedureCheckBox.Checked)
{
IList<Batch> batches2 = new List<Batch>();
foreach (var b in batches)
{
if (b.ProcedureName.Equals(procedureComboBox.Text)) batches2.Add(b);
}
batches = batches2;
}
if (purchaseOrderCheckBox.Checked)
{
IList<Batch> batches3 = new List<Batch>();
foreach (var b in batches)
{
if (b.WaterMeters[0].PurchaseOrder.Equals(purchaseOrderComboBox.Text)) batches3.Add(b);
}
batches = batches3;
}
QueryBatches = batches;
batchesQueried = true;
RedrawQueryList();
///
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void queryWatermetersButton_Click(object sender, EventArgs e)
{
if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked &&
!filterDateCheckBox.Checked && !batchNrCheckBox.Checked)
{
return;
}
queryResultsListBox.Items.Clear();
try
{
bool purchaseOrderFiltered = false;
bool procedureFiltered = false;
ISession session = Results.DB.CreateSession();
IList<WaterMeter> waterMeters;
if (filterDateCheckBox.Checked)
{
IList<Batch> batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.EndTime)
.IsBetween(fromDateTimePicker.Value.Date)
.And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1))
//.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
waterMeters = new List<WaterMeter>();
foreach (var b in batches)
{
foreach (var wm in b.WaterMeters) waterMeters.Add(wm);
}
}
else if (purchaseOrderCheckBox.Checked)
{
waterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.PurchaseOrder == purchaseOrderCheckBox.Text))
.List<WaterMeter>();
purchaseOrderFiltered = true;
}
else if (procedureCheckBox.Checked && !procedureFiltered)
{
waterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch.ProcedureName == procedureComboBox.Text))
.List<WaterMeter>();
procedureFiltered = true;
}
else
{
waterMeters = session.QueryOver<WaterMeter>().List<WaterMeter>();
}
if (purchaseOrderCheckBox.Checked && !purchaseOrderFiltered)
{
IList<WaterMeter> waterMeters3 = new List<WaterMeter>();
foreach (var wm in waterMeters)
{
if (wm.PurchaseOrder.Equals(purchaseOrderComboBox.Text)) waterMeters3.Add(wm);
}
waterMeters = waterMeters3;
purchaseOrderFiltered = true;
}
if (procedureCheckBox.Checked && !procedureFiltered)
{
IList<WaterMeter> waterMeters2 = new List<WaterMeter>();
foreach (var wm in waterMeters)
{
if (wm.Batch.ProcedureName.Equals(procedureComboBox.Text)) waterMeters2.Add(wm);
}
waterMeters = waterMeters2;
procedureFiltered = true;
}
QueryWaterMeters = waterMeters;
batchesQueried = false;
RedrawQueryList();
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void queryResultsListBox_DoubleClick(object sender, EventArgs e)
{
}
private void reportListBox_DoubleClick(object sender, EventArgs e)
{
}
}
}
@@ -1,16 +1,15 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
using TBF.BenchControl;
namespace TBF.BenchControl.ResultsPrinters.Munich
namespace ResultsBrowser.Output.Printers.QueryResults
{
public class MunichPrintDocument : PrintDocument
public class QueryResultsPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
@@ -55,9 +54,9 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public MunichPrintDocument(string docVersion,
Results.Entities.WaterMeter wm,
PageOrientation pageOrientation)
public QueryResultsPrintDocument(string docVersion,
Results.Entities.WaterMeter wm,
PageOrientation pageOrientation)
{
this.docVersion = docVersion;
this.wm = wm;
@@ -115,8 +114,6 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
// Run base code
base.OnPrintPage(e);
e.Graphics.DrawImageUnscaled(Properties.Resources.Headpic, 0, 0);
/// 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;
int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
@@ -241,7 +238,7 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientHumiAve().ToString("F0") + " %");
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbientPressAve()).ToString("F0") + " mbar");
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbientPressAve().ToString("F0") + " mbar");
lineNr++;
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
@@ -284,7 +281,7 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
if (compound)
{
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
PrintAt(e, FromTest(rowCnt, 2), mainMtr.VolumeMeter.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 3), auxMtr.VolumeMeter.ToString("F2"));
@@ -299,11 +296,11 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO");
}
PrintAt(e, FromTest(rowCnt, 6), mtr.TestRslt.FlowMass.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempOutAvrg.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempDownMean.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 8), mtr.TestRslt.DensityDiv.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 9), mtr.TestTime.ToString("F1"));
PrintAt(e, FromTest(rowCnt, 10), mtr.TestRslt.PressUpAvrg.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 11), mtr.TestRslt.PressDownAvrg.ToString("F2"));
PrintAt(e, FromTest(rowCnt, 10), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
PrintAt(e, FromTest(rowCnt, 11), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
rowCnt++;
}
@@ -0,0 +1,183 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using Config.Entities;
namespace ResultsBrowser.Output.Printers.Statistics
{
public class StatisticsPrintDocument : PrintDocument
{
const string FontFamilyName = "Arial"; //"Times New Roman";
const int SpacingOne = 20;
const int BorderW = 1; /// Table border line width
const int TopPadding = 2; /// Margins of the text from table lines
const int LeftPadding = 2; /// Margins of the text from table lines
const int TableTop = 50;
///
/// Data to print
///
string title;
string[,] table;
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font boldFont;
Font fontTitle;
/// <summary>
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public StatisticsPrintDocument(string title, string[,] table, PageOrientation pageOrientation)
{
this.title = title;
this.table = table;
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
}
/// <summary>
/// Override the default onbeginPrint method of the PrintDocument Object.
/// </summary>
/// <param name=e></param>
/// <remarks></remarks>
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
{
base.OnBeginPrint(e);
if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); }
if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); }
if (fontTitle == null) { fontTitle = new Font(FontFamilyName, 14, FontStyle.Bold); }
}
/// <summary>
/// Override the default OnPrintPage method of the PrintDocument.
/// </summary>
/// <param name=e></param>
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
// Run base code
base.OnPrintPage(e);
/// 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;
int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
int leftMargin = base.DefaultPageSettings.Margins.Left; /// X
int topMargin = base.DefaultPageSettings.Margins.Top; /// Y
/// Check if the user selected to print in Landscape mode
/// if they did then we need to swap height/width parameters
if (base.DefaultPageSettings.Landscape)
{
int tmp = printHeight;
printHeight = printWidth;
printWidth = tmp;
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
RectangleF printArea = new RectangleF(leftMargin, topMargin, 667, TableTop);
e.Graphics.DrawString(title, this.fontTitle, Brushes.Black, printArea);
/// Measure texts
float[] columnWidths = new float[table.GetLength(1)];
for (int c = 0; c < columnWidths.Length; c++)
{
columnWidths[c] = e.Graphics.MeasureString(table[0, c], font).Width;
for (int r = 1; r < table.GetLength(0); r++)
{
float width = e.Graphics.MeasureString(table[r, c], font).Width;
if (width > columnWidths[c]) columnWidths[c] = width;
}
}
float[] rowHeights = new float[table.GetLength(0)];
for (int i = 0; i < rowHeights.Length; i++) rowHeights[i] = SpacingOne;
float top = (float)(topMargin + TableTop);
DrawTable(e, leftMargin, top, columnWidths, rowHeights);
/// Print texts
for (int r = 0; r < table.GetLength(0); r++)
{
float left = leftMargin;
for (int c = 0; c < columnWidths.Length; c++)
{
float textWidth = e.Graphics.MeasureString(table[r, c], font).Width;
float leftOffset = (columnWidths[c] - textWidth) / 2;
PrintAt(e, new Point((int)(left + leftOffset + LeftPadding), (int)top + 2), table[r, c]);
left += columnWidths[c];
}
top += rowHeights[r];
}
}
/// <summary>
/// Draw table lines.
/// </summary>
void DrawTable(System.Drawing.Printing.PrintPageEventArgs e, float left, float top, float[] columnWidths, float[] rowHeights)
{
float width = 0;
foreach (var cw in columnWidths) width += cw;
/// First horizontal line
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point((int)left, (int)top), new Point((int)(left + width), (int)top));
float height = 0;
foreach (var rh in rowHeights)
{
height += rh;
/// Horizontal line
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point((int)left, (int)(top + height)), new Point((int)(left + width), (int)(top + height)));
}
/// First vertical line
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point((int)left, (int)top), new Point((int)left, (int)(top + height)));
width = 0;
foreach (var cw in columnWidths)
{
width += cw;
/// Vertical line
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point((int)(left + width), (int)top), new Point((int)(left + width), (int)(top + height)));
}
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintAt(e, p.X, p.Y, text);
}
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.font, Brushes.Black, printArea);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintBoldAt(e, p.X, p.Y, text);
}
void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
}
}
}
+4 -19
View File
@@ -31,13 +31,6 @@ namespace ResultsBrowser
static readonly ILog log; /// log4net
/// <summary>
/// Main window object.
/// </summary>
public static MainWnd MainWnd;
public static RBrowserWnd RBrowserWnd;
public static ResultsBrowserWnd ResultsBrowserWnd;
static Program()
{
/// Program version string
@@ -65,7 +58,7 @@ namespace ResultsBrowser
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
static void Main(string[] args)
{
///
/// Load the local settings
@@ -127,21 +120,13 @@ namespace ResultsBrowser
try
{
/// Open the main application window
log.Info("Creating the main window");
#if false //IPERLST || IPERLST_SPECIAL
MainWnd = new MainWnd();
log.Info("Opening the main window");
Application.Run(MainWnd);
#else
ResultsBrowserWnd = new ResultsBrowserWnd();
log.Info("Opening the main window");
Application.Run(ResultsBrowserWnd);
#endif
log.Info("Creating and opening the main window");
Application.Run(new ResultsBrowserWnd(args));
log.Info("The main window was closed");
}
catch (Exception e)
{
LogException(log, "Exception in Application.Run(MainWnd)", e);
LogException(log, "Exception in Application.Run(new ResultsBrowserWnd(args))", e);
}
finally
{
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("ResultsBrowser")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2016 Sensus Slovensko a.s.")]
[assembly: AssemblyCopyright("Copyright © 2015 - 2017 Sensus Slovensko a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.10.352.0")]
[assembly: AssemblyFileVersion("2.10.352.0")]
[assembly: AssemblyVersion("2.12.486.0")]
[assembly: AssemblyFileVersion("2.12.486.0")]
-607
View File
@@ -1,607 +0,0 @@
namespace ResultsBrowser
{
partial class RBrowserWnd
{
/// <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.queryBatchesButton = new System.Windows.Forms.Button();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.queryResultsItemsLabel = new System.Windows.Forms.Label();
this.queryWatermetersButton = new System.Windows.Forms.Button();
this.batchNrGroupBox = new System.Windows.Forms.GroupBox();
this.batchNrToTextBox = new System.Windows.Forms.TextBox();
this.batchNrFromTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.batchNrCheckBox = new System.Windows.Forms.CheckBox();
this.removeFromQueryButton = new System.Windows.Forms.Button();
this.addToReportButton = new System.Windows.Forms.Button();
this.procedureGroupBox = new System.Windows.Forms.GroupBox();
this.procedureCheckBox = new System.Windows.Forms.CheckBox();
this.procedureComboBox = new System.Windows.Forms.ComboBox();
this.fromGroupBox = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.filterDateCheckBox = new System.Windows.Forms.CheckBox();
this.toDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.purchaseOrderGroupBox = new System.Windows.Forms.GroupBox();
this.purchaseOrderCheckBox = new System.Windows.Forms.CheckBox();
this.purchaseOrderComboBox = new System.Windows.Forms.ComboBox();
this.queryResultsListBox = new System.Windows.Forms.ListBox();
this.configReportButton = new System.Windows.Forms.Button();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.reportItemsLabel = new System.Windows.Forms.Label();
this.configButton = new System.Windows.Forms.Button();
this.makeReportButton = new System.Windows.Forms.Button();
this.removeFromReportButton = new System.Windows.Forms.Button();
this.reportFileGroupBox = new System.Windows.Forms.GroupBox();
this.browseFileButton = new System.Windows.Forms.Button();
this.reportFileComboBox = new System.Windows.Forms.ComboBox();
this.makeAscFileButton = new System.Windows.Forms.Button();
this.reportListBox = new System.Windows.Forms.ListBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.batchNrGroupBox.SuspendLayout();
this.procedureGroupBox.SuspendLayout();
this.fromGroupBox.SuspendLayout();
this.purchaseOrderGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.reportFileGroupBox.SuspendLayout();
this.SuspendLayout();
//
// queryBatchesButton
//
this.queryBatchesButton.Location = new System.Drawing.Point(130, 136);
this.queryBatchesButton.Name = "queryBatchesButton";
this.queryBatchesButton.Size = new System.Drawing.Size(108, 29);
this.queryBatchesButton.TabIndex = 3;
this.queryBatchesButton.Text = "Query batches";
this.queryBatchesButton.UseVisualStyleBackColor = true;
this.queryBatchesButton.Click += new System.EventHandler(this.queryBatchesButton_Click);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.radioButton3);
this.splitContainer1.Panel1.Controls.Add(this.radioButton2);
this.splitContainer1.Panel1.Controls.Add(this.radioButton1);
this.splitContainer1.Panel1.Controls.Add(this.queryResultsItemsLabel);
this.splitContainer1.Panel1.Controls.Add(this.queryWatermetersButton);
this.splitContainer1.Panel1.Controls.Add(this.batchNrGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.removeFromQueryButton);
this.splitContainer1.Panel1.Controls.Add(this.addToReportButton);
this.splitContainer1.Panel1.Controls.Add(this.procedureGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.fromGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.queryBatchesButton);
this.splitContainer1.Panel1.Controls.Add(this.purchaseOrderGroupBox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.queryResultsListBox);
this.splitContainer1.Size = new System.Drawing.Size(604, 624);
this.splitContainer1.SplitterDistance = 190;
this.splitContainer1.TabIndex = 5;
//
// radioButton3
//
this.radioButton3.AutoSize = true;
this.radioButton3.Location = new System.Drawing.Point(15, 164);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(61, 17);
this.radioButton3.TabIndex = 16;
this.radioButton3.TabStop = true;
this.radioButton3.Text = "bench3";
this.radioButton3.UseVisualStyleBackColor = true;
this.radioButton3.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged);
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(15, 145);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(61, 17);
this.radioButton2.TabIndex = 15;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "bench2";
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Location = new System.Drawing.Point(15, 126);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(61, 17);
this.radioButton1.TabIndex = 14;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "bench1";
this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// queryResultsItemsLabel
//
this.queryResultsItemsLabel.AutoSize = true;
this.queryResultsItemsLabel.Location = new System.Drawing.Point(255, 177);
this.queryResultsItemsLabel.Name = "queryResultsItemsLabel";
this.queryResultsItemsLabel.Size = new System.Drawing.Size(40, 13);
this.queryResultsItemsLabel.TabIndex = 13;
this.queryResultsItemsLabel.Text = "0 items";
//
// queryWatermetersButton
//
this.queryWatermetersButton.Location = new System.Drawing.Point(258, 136);
this.queryWatermetersButton.Name = "queryWatermetersButton";
this.queryWatermetersButton.Size = new System.Drawing.Size(108, 29);
this.queryWatermetersButton.TabIndex = 12;
this.queryWatermetersButton.Text = "Query water meters";
this.queryWatermetersButton.UseVisualStyleBackColor = true;
this.queryWatermetersButton.Click += new System.EventHandler(this.queryWatermetersButton_Click);
//
// batchNrGroupBox
//
this.batchNrGroupBox.Controls.Add(this.batchNrToTextBox);
this.batchNrGroupBox.Controls.Add(this.batchNrFromTextBox);
this.batchNrGroupBox.Controls.Add(this.label4);
this.batchNrGroupBox.Controls.Add(this.label3);
this.batchNrGroupBox.Controls.Add(this.batchNrCheckBox);
this.batchNrGroupBox.Location = new System.Drawing.Point(222, 14);
this.batchNrGroupBox.Name = "batchNrGroupBox";
this.batchNrGroupBox.Size = new System.Drawing.Size(149, 104);
this.batchNrGroupBox.TabIndex = 11;
this.batchNrGroupBox.TabStop = false;
//
// batchNrToTextBox
//
this.batchNrToTextBox.Location = new System.Drawing.Point(56, 65);
this.batchNrToTextBox.Name = "batchNrToTextBox";
this.batchNrToTextBox.Size = new System.Drawing.Size(62, 20);
this.batchNrToTextBox.TabIndex = 5;
//
// batchNrFromTextBox
//
this.batchNrFromTextBox.Location = new System.Drawing.Point(56, 33);
this.batchNrFromTextBox.Name = "batchNrFromTextBox";
this.batchNrFromTextBox.Size = new System.Drawing.Size(62, 20);
this.batchNrFromTextBox.TabIndex = 4;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(19, 68);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(20, 13);
this.label4.TabIndex = 3;
this.label4.Text = "To";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(19, 36);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(30, 13);
this.label3.TabIndex = 2;
this.label3.Text = "From";
//
// batchNrCheckBox
//
this.batchNrCheckBox.AutoSize = true;
this.batchNrCheckBox.Location = new System.Drawing.Point(19, 0);
this.batchNrCheckBox.Name = "batchNrCheckBox";
this.batchNrCheckBox.Size = new System.Drawing.Size(116, 17);
this.batchNrCheckBox.TabIndex = 1;
this.batchNrCheckBox.Text = "Filter batch number";
this.batchNrCheckBox.UseVisualStyleBackColor = true;
//
// removeFromQueryButton
//
this.removeFromQueryButton.Location = new System.Drawing.Point(377, 136);
this.removeFromQueryButton.Name = "removeFromQueryButton";
this.removeFromQueryButton.Size = new System.Drawing.Size(114, 29);
this.removeFromQueryButton.TabIndex = 9;
this.removeFromQueryButton.Text = "Remove selected";
this.removeFromQueryButton.UseVisualStyleBackColor = true;
this.removeFromQueryButton.Click += new System.EventHandler(this.removeFromQueryButton_Click);
//
// addToReportButton
//
this.addToReportButton.Location = new System.Drawing.Point(558, 130);
this.addToReportButton.Name = "addToReportButton";
this.addToReportButton.Size = new System.Drawing.Size(46, 40);
this.addToReportButton.TabIndex = 8;
this.addToReportButton.Text = ">>>";
this.addToReportButton.UseVisualStyleBackColor = true;
this.addToReportButton.Click += new System.EventHandler(this.addToReportButton_Click);
//
// procedureGroupBox
//
this.procedureGroupBox.Controls.Add(this.procedureCheckBox);
this.procedureGroupBox.Controls.Add(this.procedureComboBox);
this.procedureGroupBox.Location = new System.Drawing.Point(15, 68);
this.procedureGroupBox.Name = "procedureGroupBox";
this.procedureGroupBox.Size = new System.Drawing.Size(201, 50);
this.procedureGroupBox.TabIndex = 6;
this.procedureGroupBox.TabStop = false;
//
// procedureCheckBox
//
this.procedureCheckBox.AutoSize = true;
this.procedureCheckBox.Location = new System.Drawing.Point(19, 0);
this.procedureCheckBox.Name = "procedureCheckBox";
this.procedureCheckBox.Size = new System.Drawing.Size(99, 17);
this.procedureCheckBox.TabIndex = 1;
this.procedureCheckBox.Text = "Filter procedure";
this.procedureCheckBox.UseVisualStyleBackColor = true;
this.procedureCheckBox.CheckedChanged += new System.EventHandler(this.procedureCheckBox_CheckedChanged);
//
// procedureComboBox
//
this.procedureComboBox.FormattingEnabled = true;
this.procedureComboBox.Location = new System.Drawing.Point(18, 19);
this.procedureComboBox.Name = "procedureComboBox";
this.procedureComboBox.Size = new System.Drawing.Size(170, 21);
this.procedureComboBox.TabIndex = 0;
//
// fromGroupBox
//
this.fromGroupBox.Controls.Add(this.label2);
this.fromGroupBox.Controls.Add(this.label1);
this.fromGroupBox.Controls.Add(this.filterDateCheckBox);
this.fromGroupBox.Controls.Add(this.toDateTimePicker);
this.fromGroupBox.Controls.Add(this.fromDateTimePicker);
this.fromGroupBox.Location = new System.Drawing.Point(377, 14);
this.fromGroupBox.Name = "fromGroupBox";
this.fromGroupBox.Size = new System.Drawing.Size(221, 104);
this.fromGroupBox.TabIndex = 3;
this.fromGroupBox.TabStop = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 68);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(20, 13);
this.label2.TabIndex = 3;
this.label2.Text = "To";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(30, 13);
this.label1.TabIndex = 2;
this.label1.Text = "From";
//
// filterDateCheckBox
//
this.filterDateCheckBox.AutoSize = true;
this.filterDateCheckBox.Location = new System.Drawing.Point(19, -1);
this.filterDateCheckBox.Name = "filterDateCheckBox";
this.filterDateCheckBox.Size = new System.Drawing.Size(72, 17);
this.filterDateCheckBox.TabIndex = 1;
this.filterDateCheckBox.Text = "Filter date";
this.filterDateCheckBox.UseVisualStyleBackColor = true;
//
// toDateTimePicker
//
this.toDateTimePicker.Location = new System.Drawing.Point(56, 65);
this.toDateTimePicker.Name = "toDateTimePicker";
this.toDateTimePicker.Size = new System.Drawing.Size(151, 20);
this.toDateTimePicker.TabIndex = 0;
//
// fromDateTimePicker
//
this.fromDateTimePicker.Location = new System.Drawing.Point(56, 32);
this.fromDateTimePicker.Name = "fromDateTimePicker";
this.fromDateTimePicker.Size = new System.Drawing.Size(151, 20);
this.fromDateTimePicker.TabIndex = 0;
//
// purchaseOrderGroupBox
//
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderCheckBox);
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderComboBox);
this.purchaseOrderGroupBox.Location = new System.Drawing.Point(15, 14);
this.purchaseOrderGroupBox.Name = "purchaseOrderGroupBox";
this.purchaseOrderGroupBox.Size = new System.Drawing.Size(201, 50);
this.purchaseOrderGroupBox.TabIndex = 2;
this.purchaseOrderGroupBox.TabStop = false;
//
// purchaseOrderCheckBox
//
this.purchaseOrderCheckBox.AutoSize = true;
this.purchaseOrderCheckBox.Location = new System.Drawing.Point(19, 0);
this.purchaseOrderCheckBox.Name = "purchaseOrderCheckBox";
this.purchaseOrderCheckBox.Size = new System.Drawing.Size(122, 17);
this.purchaseOrderCheckBox.TabIndex = 1;
this.purchaseOrderCheckBox.Text = "Filter purchase order";
this.purchaseOrderCheckBox.UseVisualStyleBackColor = true;
//
// purchaseOrderComboBox
//
this.purchaseOrderComboBox.FormattingEnabled = true;
this.purchaseOrderComboBox.Location = new System.Drawing.Point(18, 19);
this.purchaseOrderComboBox.Name = "purchaseOrderComboBox";
this.purchaseOrderComboBox.Size = new System.Drawing.Size(170, 21);
this.purchaseOrderComboBox.TabIndex = 0;
//
// queryResultsListBox
//
this.queryResultsListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.queryResultsListBox.FormattingEnabled = true;
this.queryResultsListBox.Location = new System.Drawing.Point(0, 0);
this.queryResultsListBox.Name = "queryResultsListBox";
this.queryResultsListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
this.queryResultsListBox.Size = new System.Drawing.Size(604, 430);
this.queryResultsListBox.TabIndex = 0;
this.queryResultsListBox.DoubleClick += new System.EventHandler(this.queryResultsListBox_DoubleClick);
//
// configReportButton
//
this.configReportButton.Location = new System.Drawing.Point(226, 95);
this.configReportButton.Name = "configReportButton";
this.configReportButton.Size = new System.Drawing.Size(103, 47);
this.configReportButton.TabIndex = 5;
this.configReportButton.Text = "Configure Report";
this.configReportButton.UseVisualStyleBackColor = true;
this.configReportButton.Click += new System.EventHandler(this.configReportButton_Click);
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(1284, 624);
this.splitContainer2.SplitterDistance = 604;
this.splitContainer2.TabIndex = 6;
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.reportItemsLabel);
this.splitContainer3.Panel1.Controls.Add(this.configButton);
this.splitContainer3.Panel1.Controls.Add(this.makeReportButton);
this.splitContainer3.Panel1.Controls.Add(this.removeFromReportButton);
this.splitContainer3.Panel1.Controls.Add(this.reportFileGroupBox);
this.splitContainer3.Panel1.Controls.Add(this.makeAscFileButton);
this.splitContainer3.Panel1.Controls.Add(this.configReportButton);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.reportListBox);
this.splitContainer3.Size = new System.Drawing.Size(676, 624);
this.splitContainer3.SplitterDistance = 190;
this.splitContainer3.TabIndex = 6;
//
// reportItemsLabel
//
this.reportItemsLabel.AutoSize = true;
this.reportItemsLabel.Location = new System.Drawing.Point(261, 177);
this.reportItemsLabel.Name = "reportItemsLabel";
this.reportItemsLabel.Size = new System.Drawing.Size(40, 13);
this.reportItemsLabel.TabIndex = 14;
this.reportItemsLabel.Text = "0 items";
//
// configButton
//
this.configButton.Location = new System.Drawing.Point(589, 14);
this.configButton.Name = "configButton";
this.configButton.Size = new System.Drawing.Size(75, 71);
this.configButton.TabIndex = 12;
this.configButton.Text = "Configure";
this.configButton.UseVisualStyleBackColor = true;
this.configButton.Click += new System.EventHandler(this.configButton_Click);
//
// makeReportButton
//
this.makeReportButton.Location = new System.Drawing.Point(335, 95);
this.makeReportButton.Name = "makeReportButton";
this.makeReportButton.Size = new System.Drawing.Size(103, 47);
this.makeReportButton.TabIndex = 11;
this.makeReportButton.Text = "Make Report";
this.makeReportButton.UseVisualStyleBackColor = true;
this.makeReportButton.Click += new System.EventHandler(this.makeReportButton_Click);
//
// removeFromReportButton
//
this.removeFromReportButton.Location = new System.Drawing.Point(60, 136);
this.removeFromReportButton.Name = "removeFromReportButton";
this.removeFromReportButton.Size = new System.Drawing.Size(114, 29);
this.removeFromReportButton.TabIndex = 10;
this.removeFromReportButton.Text = "Remove selected";
this.removeFromReportButton.UseVisualStyleBackColor = true;
this.removeFromReportButton.Click += new System.EventHandler(this.removeFromReportButton_Click);
//
// reportFileGroupBox
//
this.reportFileGroupBox.Controls.Add(this.browseFileButton);
this.reportFileGroupBox.Controls.Add(this.reportFileComboBox);
this.reportFileGroupBox.Location = new System.Drawing.Point(18, 14);
this.reportFileGroupBox.Name = "reportFileGroupBox";
this.reportFileGroupBox.Size = new System.Drawing.Size(546, 63);
this.reportFileGroupBox.TabIndex = 8;
this.reportFileGroupBox.TabStop = false;
this.reportFileGroupBox.Text = "Report file name";
//
// browseFileButton
//
this.browseFileButton.Location = new System.Drawing.Point(453, 22);
this.browseFileButton.Name = "browseFileButton";
this.browseFileButton.Size = new System.Drawing.Size(75, 27);
this.browseFileButton.TabIndex = 2;
this.browseFileButton.Text = "Browse";
this.browseFileButton.UseVisualStyleBackColor = true;
this.browseFileButton.Click += new System.EventHandler(this.browseFileButton_Click);
//
// reportFileComboBox
//
this.reportFileComboBox.FormattingEnabled = true;
this.reportFileComboBox.Location = new System.Drawing.Point(20, 25);
this.reportFileComboBox.Name = "reportFileComboBox";
this.reportFileComboBox.Size = new System.Drawing.Size(414, 21);
this.reportFileComboBox.TabIndex = 1;
//
// makeAscFileButton
//
this.makeAscFileButton.Location = new System.Drawing.Point(443, 95);
this.makeAscFileButton.Name = "makeAscFileButton";
this.makeAscFileButton.Size = new System.Drawing.Size(103, 47);
this.makeAscFileButton.TabIndex = 7;
this.makeAscFileButton.Text = "Make *.asc File";
this.makeAscFileButton.UseVisualStyleBackColor = true;
this.makeAscFileButton.Click += new System.EventHandler(this.makeAscFileButton_Click);
//
// reportListBox
//
this.reportListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.reportListBox.FormattingEnabled = true;
this.reportListBox.Location = new System.Drawing.Point(0, 0);
this.reportListBox.Name = "reportListBox";
this.reportListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
this.reportListBox.Size = new System.Drawing.Size(676, 430);
this.reportListBox.TabIndex = 0;
this.reportListBox.DoubleClick += new System.EventHandler(this.reportListBox_DoubleClick);
//
// RBrowserWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1284, 624);
this.Controls.Add(this.splitContainer2);
this.Name = "RBrowserWnd";
this.Text = "Results browser";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWnd_FormClosing);
this.Load += new System.EventHandler(this.MainWnd_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.batchNrGroupBox.ResumeLayout(false);
this.batchNrGroupBox.PerformLayout();
this.procedureGroupBox.ResumeLayout(false);
this.procedureGroupBox.PerformLayout();
this.fromGroupBox.ResumeLayout(false);
this.fromGroupBox.PerformLayout();
this.purchaseOrderGroupBox.ResumeLayout(false);
this.purchaseOrderGroupBox.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.reportFileGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button queryBatchesButton;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.GroupBox fromGroupBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox filterDateCheckBox;
private System.Windows.Forms.DateTimePicker toDateTimePicker;
private System.Windows.Forms.DateTimePicker fromDateTimePicker;
private System.Windows.Forms.GroupBox purchaseOrderGroupBox;
private System.Windows.Forms.CheckBox purchaseOrderCheckBox;
private System.Windows.Forms.ComboBox purchaseOrderComboBox;
private System.Windows.Forms.Button configReportButton;
private System.Windows.Forms.GroupBox procedureGroupBox;
private System.Windows.Forms.CheckBox procedureCheckBox;
private System.Windows.Forms.ComboBox procedureComboBox;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Button makeAscFileButton;
private System.Windows.Forms.ListBox queryResultsListBox;
private System.Windows.Forms.ListBox reportListBox;
private System.Windows.Forms.GroupBox reportFileGroupBox;
private System.Windows.Forms.Button browseFileButton;
private System.Windows.Forms.ComboBox reportFileComboBox;
private System.Windows.Forms.Button removeFromQueryButton;
private System.Windows.Forms.Button addToReportButton;
private System.Windows.Forms.Button removeFromReportButton;
private System.Windows.Forms.GroupBox batchNrGroupBox;
private System.Windows.Forms.TextBox batchNrToTextBox;
private System.Windows.Forms.TextBox batchNrFromTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox batchNrCheckBox;
private System.Windows.Forms.Button makeReportButton;
private System.Windows.Forms.Button configButton;
private System.Windows.Forms.Button queryWatermetersButton;
private System.Windows.Forms.Label queryResultsItemsLabel;
private System.Windows.Forms.Label reportItemsLabel;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
}
}
-627
View File
@@ -1,627 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using log4net;
using NHibernate;
using Results.Entities;
namespace ResultsBrowser
{
public partial class RBrowserWnd : Form
{
static readonly ILog log = LogManager.GetLogger(typeof(RBrowserWnd));
bool batchesQueried;
public static IList<Batch> QueryBatches;
public static IList<WaterMeter> QueryWaterMeters;
public static IList<Batch> ReportBatches;
public static IList<WaterMeter> ReportWaterMeters;
public IList<Results.ItemSpec> ReportItems_Single;
public IList<Results.ItemSpec> ReportItems_Compound;
int batchFrom;
int batchTo;
public RBrowserWnd()
{
InitializeComponent();
QueryBatches = new List<Batch>();
QueryWaterMeters = new List<WaterMeter>();
ReportBatches = new List<Batch>();
ReportWaterMeters = new List<WaterMeter>();
}
private void MainWnd_Load(object sender, EventArgs e)
{
PrepareComboBoxHistory(Program.LocalSettings.PurchaseOrderHistory, purchaseOrderComboBox);
PrepareComboBoxHistory(Program.LocalSettings.ProcedureHistory, procedureComboBox);
PrepareComboBoxHistory(Program.LocalSettings.ReportFileNameHistory, reportFileComboBox);
purchaseOrderComboBox.Text = Program.LocalSettings.LastPurchaseOrder;
procedureComboBox.Text = Program.LocalSettings.LastProcedure;
reportFileComboBox.Text = Program.LocalSettings.LastReportFileName;
ReportItems_Single = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Single);
ReportItems_Compound = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Compound);
purchaseOrderCheckBox.Checked = Program.LocalSettings.FilterPurchaseOrder;
procedureCheckBox.Checked = Program.LocalSettings.FilterProcedure;
batchNrCheckBox.Checked = Program.LocalSettings.FilterBatchNr;
filterDateCheckBox.Checked = Program.LocalSettings.FilterDate;
batchNrFromTextBox.Text = Program.LocalSettings.BatchFrom;
batchNrToTextBox.Text = Program.LocalSettings.BatchTo;
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString1;
UpdateRadioButtons();
radioButton1.Checked = true;
radioButton2.Checked = false;
radioButton3.Checked = false;
}
void UpdateRadioButtons()
{
if (string.IsNullOrEmpty(Program.LocalSettings.Bench1))
{
radioButton1.Visible = false;
}
else
{
radioButton1.Visible = true;
radioButton1.Text = Program.LocalSettings.Bench1;
}
if (string.IsNullOrEmpty(Program.LocalSettings.Bench2))
{
radioButton2.Visible = false;
}
else
{
radioButton2.Visible = true;
radioButton2.Text = Program.LocalSettings.Bench1;
}
if (string.IsNullOrEmpty(Program.LocalSettings.Bench3))
{
radioButton3.Visible = false;
}
else
{
radioButton3.Visible = true;
radioButton3.Text = Program.LocalSettings.Bench1;
}
}
private void MainWnd_FormClosing(object sender, FormClosingEventArgs e)
{
Program.LocalSettings.UpdateHistory(purchaseOrderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(procedureComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(reportFileComboBox.Text, ref Program.LocalSettings.ReportFileNameHistory);
Program.LocalSettings.LastPurchaseOrder = purchaseOrderComboBox.Text;
Program.LocalSettings.LastProcedure = procedureComboBox.Text;
Program.LocalSettings.LastReportFileName = reportFileComboBox.Text;
Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single);
Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound);
Program.LocalSettings.FilterPurchaseOrder = purchaseOrderCheckBox.Checked;
Program.LocalSettings.FilterProcedure = procedureCheckBox.Checked;
Program.LocalSettings.FilterBatchNr = batchNrCheckBox.Checked;
Program.LocalSettings.FilterDate = filterDateCheckBox.Checked;
Program.LocalSettings.BatchFrom = batchNrFromTextBox.Text;
Program.LocalSettings.BatchTo = batchNrToTextBox.Text;
Program.LocalSettings.Save();
}
void RedrawLists()
{
RedrawQueryList();
RedrawReportList();
}
void RedrawQueryList()
{
queryResultsListBox.Items.Clear();
if (batchesQueried)
{
foreach (var b in QueryBatches) queryResultsListBox.Items.Add(b.ToString());
}
else
{
foreach (var wmr in QueryWaterMeters) queryResultsListBox.Items.Add(wmr);
}
int nrItems = queryResultsListBox.Items.Count;
if (nrItems == 0) queryResultsListBox.Items.Add("<empty>");
queryResultsItemsLabel.Text = string.Format("{0} items", nrItems);
}
void RedrawReportList()
{
reportListBox.Items.Clear();
foreach (var wmr in ReportWaterMeters) reportListBox.Items.Add(wmr);
int nrItems = reportListBox.Items.Count;
if (nrItems == 0) reportListBox.Items.Add("<empty>");
reportItemsLabel.Text = string.Format("{0} items", nrItems);
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="comboBox">Puchase order ComboBox</param>
void PrepareComboBoxHistory(string[] history, ComboBox comboBox)
{
if (history == null || history.Length == 0) return;
for (int i = 0; i < history.Length; i++) comboBox.Items.Add(history[i]);
if (comboBox.Items.Count > 0) comboBox.Text = comboBox.Items[0].ToString();
}
private bool ParseAllFields()
{
try
{
if (batchNrCheckBox.Checked)
{
batchFrom = int.Parse(batchNrFromTextBox.Text);
batchTo = int.Parse(batchNrToTextBox.Text);
if (batchFrom < 0) throw new Exception("Batch numbers: from < 0 !");
if (batchTo < batchFrom) throw new Exception("Batch numbers: from > to !");
}
return true;
}
catch (Exception e)
{
MessageBox.Show(string.Format("{0}", e.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
}
private void filterDateCheckBox_CheckedChanged(object sender, EventArgs e)
{
fromDateTimePicker.Enabled = toDateTimePicker.Enabled = filterDateCheckBox.Checked;
}
private void purchaseOrderCheckBox_CheckedChanged(object sender, EventArgs e)
{
purchaseOrderComboBox.Enabled = purchaseOrderCheckBox.Checked;
}
private void procedureCheckBox_CheckedChanged(object sender, EventArgs e)
{
procedureComboBox.Enabled = procedureCheckBox.Checked;
}
private void clearButton_Click(object sender, EventArgs e)
{
QueryWaterMeters.Clear();
queryResultsListBox.Items.Clear();
}
private void configReportButton_Click(object sender, EventArgs e)
{
Forms.ResultsConfig dlg = new Forms.ResultsConfig(false);
dlg.ReportItems_Single = ReportItems_Single;
dlg.ReportItems_Compound = ReportItems_Compound;
if (DialogResult.OK == dlg.ShowDialog())
{
ReportItems_Single = dlg.ReportItems_Single;
ReportItems_Compound = dlg.ReportItems_Compound;
Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single);
Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound);
}
}
private void removeFromQueryButton_Click(object sender, EventArgs e)
{
try
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = queryResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
if (batchesQueried)
{
QueryBatches.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
else
{
QueryWaterMeters.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
}
RedrawLists();
}
catch
{
MessageBox.Show("Something strange happened", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void removeFromReportButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = reportListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
ReportWaterMeters.RemoveAt(reportListBox.SelectedIndices[i]);
}
RedrawLists();
}
private void addToReportButton_Click(object sender, EventArgs e)
{
if (batchesQueried)
{
foreach (var b in QueryBatches)
{
foreach (var wm in b.WaterMeters) ReportWaterMeters.Add(wm);
}
}
else
{
foreach (var wm in QueryWaterMeters)
{
if (!ReportWaterMeters.Contains(wm)) ReportWaterMeters.Add(wm);
}
}
RedrawLists();
}
private void browseFileButton_Click(object sender, EventArgs e)
{
SaveFileDialog dlg = new SaveFileDialog();
dlg.Title = "Target file";
if (dlg.ShowDialog() == DialogResult.OK)
{
reportFileComboBox.Text = dlg.FileName;
}
}
/// <summary>
/// Create ASC file in R.Uhlik format
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void makeAscFileButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(reportFileComboBox.Text))
{
MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (ReportItems_Single == null || ReportItems_Single.Count == 0)
{
MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true))
{
foreach (var wm in ReportWaterMeters)
{
try
{
StringBuilder sb = new StringBuilder();
sb.Append(wm.SerialNr);
sb.Append(';'); sb.Append(wm.ProductName());
sb.Append(';'); sb.Append(wm.ApprovalInfo());
sb.Append(';'); sb.Append(wm.MetrologicalClass());
sb.Append(';'); sb.Append("0");
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q1") != null ? wm.GetTestRslt("Q1").Qfrom() : 0)).ToString("F0")); /// Q1 nominal
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q2") != null ? wm.GetTestRslt("Q2").Qfrom() : 0)).ToString("F0")); /// Q2 nominal
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q3") != null ? wm.GetTestRslt("Q3").Qto() : 0)).ToString("F0")); /// Q3 nominal
sb.Append(';'); sb.Append("0"); /// Q4 nominal
sb.Append(';'); sb.Append("6"); /// Worker code
sb.Append(';'); sb.Append(ToShortStr(wm.EndTime()));
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q1") != null ? wm.GetMeterTestRslt("Q1").Error : 99).ToString("F1")); /// Q1 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q2") != null ? wm.GetMeterTestRslt("Q2").Error : 99).ToString("F1")); /// Q2 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q3") != null ? wm.GetMeterTestRslt("Q3").Error : 99).ToString("F1")); /// Q3 Error [%]
sb.Append(';'); sb.Append("0"); /// Q4 Error [%]
sb.Append(';'); sb.Append(wm.BenchId().ToString()); ///
sb.Append(';'); sb.Append(wm.PurchaseOrder);
sb.Append(';'); sb.Append("");
sb.Append(';'); sb.Append("10000");
sb.Append(';'); sb.Append(wm.ProcedureName().Substring(0, 8));
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"');
report.WriteLine(sb);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
static string ToShortStr(DateTime date)
{
return (((date.Year % 100) * 100 + date.Month) * 100 + date.Day).ToString();
}
private void makeReportButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(reportFileComboBox.Text))
{
MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (ReportItems_Single == null || ReportItems_Single.Count == 0)
{
MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true))
{
foreach (var wm in ReportWaterMeters)
{
try
{
StringBuilder sb = new StringBuilder();
sb.Append(wm.SerialNr);
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"'); /// PCB number
sb.Append(";\""); sb.Append(wm.ProcedureName()); sb.Append('"'); /// Procedure name
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("q3") != null ? wm.GetTestRslt("q3").Qto() : 0)).ToString("F0")); /// Q3 nominal
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("adjustment") != null ? wm.GetMeterTestRslt("adjustment").Error : 99).ToString("F2"));/// Adjustment Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q3") != null ? wm.GetMeterTestRslt("q1").Error : 99).ToString("F2")); /// Q1 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q2") != null ? wm.GetMeterTestRslt("q2").Error : 99).ToString("F2")); /// Q2 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q1") != null ? wm.GetMeterTestRslt("q3").Error : 99).ToString("F2")); /// Q3 Error [%]
sb.Append(';'); sb.Append(wm.StartTime().ToShortTimeString());
sb.Append(';'); sb.Append(wm.EndTime().ToShortTimeString());
report.WriteLine(sb);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void configButton_Click(object sender, EventArgs e)
{
if ((new Forms.DatabaseSettingsDlg()).ShowDialog() == DialogResult.OK)
{
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString1;
radioButton1.Text = Program.LocalSettings.Bench1;
radioButton2.Text = Program.LocalSettings.Bench2;
radioButton3.Text = Program.LocalSettings.Bench3;
}
}
private void queryBatchesButton_Click(object sender, EventArgs e)
{
if (!ParseAllFields())
{
MessageBox.Show("Something's wrong", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked &&
!filterDateCheckBox.Checked && !batchNrCheckBox.Checked)
{
MessageBox.Show("At least one filter must be on", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
queryResultsListBox.Items.Clear();
try
{
ISession session = Results.DB.CreateSession();
IList<Batch> batches;
if (filterDateCheckBox.Checked)
{
batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.EndTime)
.IsBetween(fromDateTimePicker.Value.Date)
.And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1))
//.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
}
else if (batchNrCheckBox.Checked)
{
batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.BatchNr)
.IsBetween(batchFrom).And(batchTo)
.List<Batch>();
}
else
{
batches = new List<Batch>();
}
//if (procedureCheckBox.Checked)
//{
// IList<Batch> batches2 = new List<Batch>();
// foreach (var b in batches)
// {
// if (b.ProcedureName.Equals(procedureComboBox.Text)) batches2.Add(b);
// }
// batches = batches2;
//}
//if (purchaseOrderCheckBox.Checked)
//{
// IList<Batch> batches3 = new List<Batch>();
// foreach (var b in batches)
// {
// if (b.WaterMeters[0].PurchaseOrder.Equals(purchaseOrderComboBox.Text)) batches3.Add(b);
// }
// batches = batches3;
//}
QueryBatches = batches;
batchesQueried = true;
RedrawQueryList();
///
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void queryWatermetersButton_Click(object sender, EventArgs e)
{
if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked &&
!filterDateCheckBox.Checked && !batchNrCheckBox.Checked)
{
return;
}
queryResultsListBox.Items.Clear();
try
{
bool purchaseOrderFiltered = false;
bool procedureFiltered = false;
ISession session = Results.DB.CreateSession();
IList<WaterMeter> waterMeters;
if (filterDateCheckBox.Checked)
{
IList<Batch> batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.EndTime)
.IsBetween(fromDateTimePicker.Value.Date)
.And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1))
//.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
waterMeters = new List<WaterMeter>();
foreach (var b in batches)
{
foreach (var wm in b.WaterMeters) waterMeters.Add(wm);
}
}
else if (purchaseOrderCheckBox.Checked)
{
waterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.PurchaseOrder == purchaseOrderCheckBox.Text))
.List<WaterMeter>();
purchaseOrderFiltered = true;
}
else if (procedureCheckBox.Checked && !procedureFiltered)
{
waterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch.ProcedureName == procedureComboBox.Text))
.List<WaterMeter>();
procedureFiltered = true;
}
else
{
waterMeters = session.QueryOver<WaterMeter>().List<WaterMeter>();
}
if (purchaseOrderCheckBox.Checked && !purchaseOrderFiltered)
{
IList<WaterMeter> waterMeters3 = new List<WaterMeter>();
foreach (var wm in waterMeters)
{
if (wm.PurchaseOrder.Equals(purchaseOrderComboBox.Text)) waterMeters3.Add(wm);
}
waterMeters = waterMeters3;
purchaseOrderFiltered = true;
}
if (procedureCheckBox.Checked && !procedureFiltered)
{
IList<WaterMeter> waterMeters2 = new List<WaterMeter>();
foreach (var wm in waterMeters)
{
if (wm.Batch.ProcedureName.Equals(procedureComboBox.Text)) waterMeters2.Add(wm);
}
waterMeters = waterMeters2;
procedureFiltered = true;
}
QueryWaterMeters = waterMeters;
batchesQueried = false;
RedrawQueryList();
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void queryResultsListBox_DoubleClick(object sender, EventArgs e)
{
}
private void reportListBox_DoubleClick(object sender, EventArgs e)
{
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString1;
}
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if (radioButton2.Checked)
{
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString2;
}
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
if (radioButton3.Checked)
{
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString3;
}
}
}
}
+4 -1
View File
@@ -175,7 +175,7 @@
<value>OK</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>Vytlačit výsledky</value>
<value>Vytisknout výsledky</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Postup</value>
@@ -234,4 +234,7 @@
<data name="Water_Meter" xml:space="preserve">
<value>Vodoměr</value>
</data>
<data name="Print" xml:space="preserve">
<value>Vytisknout</value>
</data>
</root>
+12
View File
@@ -234,4 +234,16 @@
<data name="CombinedBtnText" xml:space="preserve">
<value>Verbund</value>
</data>
<data name="Count" xml:space="preserve">
<value>Anzahl</value>
</data>
<data name="Page_orientation" xml:space="preserve">
<value>Seitenausrichtung</value>
</data>
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
<value>Ja = Porträt, Nein = Landschaft</value>
</data>
<data name="Print" xml:space="preserve">
<value>Drucken</value>
</data>
</root>
+813
View File
@@ -0,0 +1,813 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Confirmation" xml:space="preserve">
<value>Potwierdzenie</value>
</data>
<data name="Do_you_want_to_save_the_procedure" xml:space="preserve">
<value>Zachować procedurę ?</value>
</data>
<data name="Error" xml:space="preserve">
<value>Błąd</value>
</data>
<data name="Error_loading_users_from_the_database" xml:space="preserve">
<value>Błąd przy ładowaniu użytkowników z bazy danych:</value>
</data>
<data name="Failed_to_create_a_sample_database" xml:space="preserve">
<value>Nie udało się utworzyć bazy danych:</value>
</data>
<data name="Failed_to_export_the_database" xml:space="preserve">
<value>Nie powódł się eksport bazy danych:</value>
</data>
<data name="Invalid_user_password_or_bench" xml:space="preserve">
<value>Niezgodny użytkownik, hasło lub stanowisko</value>
</data>
<data name="Test_bench" xml:space="preserve">
<value>Stanowisko pomiarowe</value>
</data>
<data name="MaxChars" xml:space="preserve">
<value>Max._X_znaków alfanumerycznych </value>
</data>
<data name="close" xml:space="preserve">
<value>Zamknąć</value>
</data>
<data name="Diverter" xml:space="preserve">
<value>Zawór</value>
</data>
<data name="Emptying_valve" xml:space="preserve">
<value>Zawór spustowy</value>
</data>
<data name="Name" xml:space="preserve">
<value>Imię</value>
</data>
<data name="Reference" xml:space="preserve">
<value>Odniesienie</value>
</data>
<data name="Reg_valve" xml:space="preserve">
<value>Zawór regulacyjny</value>
</data>
<data name="Balance" xml:space="preserve">
<value>Waga</value>
</data>
<data name="Duration_s" xml:space="preserve">
<value>Czas trwania [s]</value>
</data>
<data name="no" xml:space="preserve">
<value>nie</value>
</data>
<data name="New_bench_path_name" xml:space="preserve">
<value>P stanowisko</value>
</data>
<data name="New_feeding_path_name" xml:space="preserve">
<value>P zasilania</value>
</data>
<data name="New_output_path_name" xml:space="preserve">
<value>PQ</value>
</data>
<data name="New_procedure_name" xml:space="preserve">
<value>Procedura</value>
</data>
<data name="New_sensors_path_name" xml:space="preserve">
<value>P czujnków</value>
</data>
<data name="New_test_name" xml:space="preserve">
<value>Test</value>
</data>
<data name="New_name_copy" xml:space="preserve">
<value>-Kopiuj'</value>
</data>
<data name="Correction_g" xml:space="preserve">
<value>Korekcja [r]</value>
</data>
<data name="Nr" xml:space="preserve">
<value>Nr</value>
</data>
<data name="Mass_kg" xml:space="preserve">
<value>Masa [kg]</value>
</data>
<data name="AddBtnText" xml:space="preserve">
<value>Dodać</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Anuluj</value>
</data>
<data name="CloseBtnText" xml:space="preserve">
<value>Zamknąć</value>
</data>
<data name="LockBtnText" xml:space="preserve">
<value>Zablokować </value>
</data>
<data name="RemoveBtnText" xml:space="preserve">
<value>Usunąć</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
</data>
<data name="Correction_lph" xml:space="preserve">
<value>Korekcja [l/h]</value>
</data>
<data name="Correction_mbar" xml:space="preserve">
<value>Korekcja [mBar]</value>
</data>
<data name="Flow_m3h" xml:space="preserve">
<value>Przepływ [m3/h]</value>
</data>
<data name="Invalid_username_or_password" xml:space="preserve">
<value>Nieprawidłowa nazwa użytkownika lub hasło</value>
</data>
<data name="CopyBtnText" xml:space="preserve">
<value>Kupiuj</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Na dół </value>
</data>
<data name="EditBtnText" xml:space="preserve">
<value>Redagować</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Do góry</value>
</data>
<data name="NoDatabaseMsg" xml:space="preserve">
<value>Nie udane połaczenie z bazą danych</value>
</data>
<data name="ConfigureDatabaseText" xml:space="preserve">
<value>Konfiguracja testowa (wymagane hasło)</value>
</data>
<data name="ExitBtnText" xml:space="preserve">
<value>Wyjście</value>
</data>
<data name="Enter_password" xml:space="preserve">
<value>Wprowadź hasło</value>
</data>
<data name="Invalid_password" xml:space="preserve">
<value>Nieprawidłowe hasło</value>
</data>
<data name="Bench_name_conflict_Use_another_name_pls" xml:space="preserve">
<value>Nazwa stanowiska nieprawidłowa, użyj innej nazwy</value>
</data>
<data name="DB_was_successfully_created" xml:space="preserve">
<value>Utworzono bazę danych !</value>
</data>
<data name="DB_will_be_overwritten" xml:space="preserve">
<value>Baza danych zostanie nadpisana</value>
</data>
<data name="Do_you_want_to_proceed" xml:space="preserve">
<value>Chcesz kontynuować ?</value>
</data>
<data name="Notification" xml:space="preserve">
<value>Powiadomienie</value>
</data>
<data name="NoBenchMsg" xml:space="preserve">
<value>W konfiguracji oprogramowania nie ma stanowiska </value>
</data>
<data name="DescriptionColHdr" xml:space="preserve">
<value>Opis</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Procedura</value>
</data>
<data name="Test" xml:space="preserve">
<value>Test</value>
</data>
<data name="Corrected" xml:space="preserve">
<value>Poprawiono</value>
</data>
<data name="Measured" xml:space="preserve">
<value>Zmierzono</value>
</data>
<data name="Bench_is_not_running" xml:space="preserve">
<value>Stanowisko nie jest włączone ale można dokonać korekty nastaw dla usunięcia tego błedu.</value>
</data>
<data name="Emptying_chdr" xml:space="preserve">
<value>Spust</value>
</data>
<data name="Bench_chdr" xml:space="preserve">
<value>Stanowisko</value>
</data>
<data name="Err_cor_neg_pct_chdr" xml:space="preserve">
<value>Błąd kor. - [%]</value>
</data>
<data name="Err_cor_pos_pct_chdr" xml:space="preserve">
<value>Błąd kor. +[%]</value>
</data>
<data name="Err_limit_neg_pct_chdr" xml:space="preserve">
<value>Błąd limit - [%]</value>
</data>
<data name="Err_limit_pos_pct_chdr" xml:space="preserve">
<value>Błąd limit + [%]</value>
</data>
<data name="Feeding_chdr" xml:space="preserve">
<value>Zasilanie</value>
</data>
<data name="Red_type_chdr" xml:space="preserve">
<value>Red. Type</value>
</data>
<data name="Error_while_creating_DB_Reason" xml:space="preserve">
<value>Błąd przy tworzeniu bazy danych. Przyczyna:</value>
</data>
<data name="Metrology" xml:space="preserve">
<value>Metrologia</value>
</data>
<data name="_offline" xml:space="preserve">
<value>Ofline</value>
</data>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Specjalista ds. kalibracji</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Kierownik laboratorium</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Konserwator</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Metrolog</value>
</data>
<data name="Close_emptying_valve" xml:space="preserve">
<value>Zamknąć zawór spustowy</value>
</data>
<data name="Get_mass_of_water_in_the_tank" xml:space="preserve">
<value>Uzyskaj masę wody w zbiorniku</value>
</data>
<data name="Ignore" xml:space="preserve">
<value>Wyłączyć</value>
</data>
<data name="Loading_the_procedure" xml:space="preserve">
<value>Procedura ładowania</value>
</data>
<data name="Make_tank_empty" xml:space="preserve">
<value>Opróżnić zbiornik</value>
</data>
<data name="Measure_the_mass" xml:space="preserve">
<value>Pomiar masy</value>
</data>
<data name="Ready" xml:space="preserve">
<value>Gotowe</value>
</data>
<data name="BackBtnText" xml:space="preserve">
<value>&lt; z powrotem</value>
</data>
<data name="FinishBtnText" xml:space="preserve">
<value>Koniec</value>
</data>
<data name="NextBtnText" xml:space="preserve">
<value>Następny &gt;</value>
</data>
<data name="Flow_selection" xml:space="preserve">
<value>Wybór przypływu</value>
</data>
<data name="Method_chdr" xml:space="preserve">
<value>Metoda badania</value>
</data>
<data name="RelativeQfrom" xml:space="preserve">
<value>Q względne od</value>
</data>
<data name="RelativeQto" xml:space="preserve">
<value>Q względne do</value>
</data>
<data name="Combined_meters" xml:space="preserve">
<value>Wodomierze sprzężone</value>
</data>
<data name="DetectionThresholdPct" xml:space="preserve">
<value>Próg detekcji [%]</value>
</data>
<data name="RateOfChangePct" xml:space="preserve">
<value>Prędkość zmiany [%]</value>
</data>
<data name="Component" xml:space="preserve">
<value>Element</value>
</data>
<data name="_none_" xml:space="preserve">
<value>&lt;nie&gt;</value>
</data>
<data name="Method_selection" xml:space="preserve">
<value>Wybór metody badania</value>
</data>
<data name="Clear_results" xml:space="preserve">
<value>Usunąć wyniki</value>
</data>
<data name="Configure" xml:space="preserve">
<value>Konfigurować</value>
</data>
<data name="Arrangement_of_meters" xml:space="preserve">
<value>Połozenie badanych liczników</value>
</data>
<data name="Arrangement_of_tests" xml:space="preserve">
<value>Położenie badań</value>
</data>
<data name="Horizontally" xml:space="preserve">
<value>Poziomo</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>Konfiguracja</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="ClearBtnText" xml:space="preserve">
<value>Usunąć</value>
</data>
<data name="Emptying_tank" xml:space="preserve">
<value>Opróżnianie zbiornika</value>
</data>
<data name="Measuring_the_weight" xml:space="preserve">
<value>Pomair wagi</value>
</data>
<data name="Emptying_i_n" xml:space="preserve">
<value>Spust ({0}: krok {1} / {2}</value>
</data>
<data name="Activity" xml:space="preserve">
<value>Aktywny</value>
</data>
<data name="Approval_info" xml:space="preserve">
<value>Informacja o zatwierdzeniu</value>
</data>
<data name="Metrological_class" xml:space="preserve">
<value>Klasa metrologiczna</value>
</data>
<data name="Producer" xml:space="preserve">
<value>Producent</value>
</data>
<data name="Printer" xml:space="preserve">
<value>Drukarka</value>
</data>
<data name="Version" xml:space="preserve">
<value>Wersja</value>
</data>
<data name="nothing_to_configure" xml:space="preserve">
<value>&lt;nie konfigurować&gt;</value>
</data>
<data name="Fill_with_water" xml:space="preserve">
<value>Napełnić stanowisko wodą ?</value>
</data>
<data name="NoBtn" xml:space="preserve">
<value>Nie</value>
</data>
<data name="Question" xml:space="preserve">
<value>Pytanie</value>
</data>
<data name="Bench_parameters" xml:space="preserve">
<value>Parametry stanowiska</value>
</data>
<data name="Connection_string" xml:space="preserve">
<value>Parametry połączenia</value>
</data>
<data name="Create_DB" xml:space="preserve">
<value>Utwórz DB</value>
</data>
<data name="Database_type" xml:space="preserve">
<value>Typ bazy danych</value>
</data>
<data name="Logging" xml:space="preserve">
<value>Logowanie</value>
</data>
<data name="Mode" xml:space="preserve">
<value>Cykl pracy</value>
</data>
<data name="NewTabBtnText" xml:space="preserve">
<value>Nowa Tab</value>
</data>
<data name="New_transition_name" xml:space="preserve">
<value>Nowa nazwa przejścia</value>
</data>
<data name="Detection_completed" xml:space="preserve">
<value>Wykrywanie zakończono</value>
</data>
<data name="Emergency_STOP" xml:space="preserve">
<value>Zatrzymanie awaryjne</value>
</data>
<data name="Add" xml:space="preserve">
<value>&amp;Dodać &gt;</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Dostępne wyniki:</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt;&amp;Usunąć</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>&lt;&lt;Usunąć wszystko</value>
</data>
<data name="Message" xml:space="preserve">
<value>Wiadomość</value>
</data>
<data name="dflt" xml:space="preserve">
<value>dflt</value>
</data>
<data name="Detection_failed" xml:space="preserve">
<value>Nie udana próba wykrywania</value>
</data>
<data name="Camera_error" xml:space="preserve">
<value>Błąd kamery</value>
</data>
<data name="remaining_time" xml:space="preserve">
<value>pozostały czas</value>
</data>
<data name="LessBtnText" xml:space="preserve">
<value>Mniej</value>
</data>
<data name="MoreBtnText" xml:space="preserve">
<value>Więcej</value>
</data>
<data name="Changes_will_be_lost_Do_you_want_to_proceed" xml:space="preserve">
<value>Zmiany zostaną stracone. Chcesz kontynuować ?</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>Przepływomierz</value>
</data>
<data name="CombinedBtnText" xml:space="preserve">
<value>Sprzężony</value>
</data>
<data name="Device" xml:space="preserve">
<value>Urządzenie</value>
</data>
<data name="PrinterBtnText" xml:space="preserve">
<value>Drukarka</value>
</data>
<data name="Aux_Water_Meter" xml:space="preserve">
<value>Wodomierz dodatkowy</value>
</data>
<data name="Aux_Water_Meter_State" xml:space="preserve">
<value>Stan dodatkowego wodomierza</value>
</data>
<data name="Data" xml:space="preserve">
<value>Dane</value>
</data>
<data name="End_State" xml:space="preserve">
<value>Stan końcowy</value>
</data>
<data name="Main_Water_Meter" xml:space="preserve">
<value>Główny wodomierz</value>
</data>
<data name="Main_Water_Meter_State" xml:space="preserve">
<value>Stan wodomierza głównego</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>Zapiska</value>
</data>
<data name="Serial_Number" xml:space="preserve">
<value>Nr seryjny</value>
</data>
<data name="Aux_WM_SerialNr" xml:space="preserve">
<value>Nr seryjny dodatkowego wodomierza</value>
</data>
<data name="Main_WM_SerialNr" xml:space="preserve">
<value>Nr seryjny głównego wodomierza</value>
</data>
<data name="Adjustment_in_progress" xml:space="preserve">
<value>Regulacja trwa</value>
</data>
<data name="Error_pct" xml:space="preserve">
<value>Błąd [%]</value>
</data>
<data name="Duration_Leak_s" xml:space="preserve">
<value>Czas trwania przepływu [s]</value>
</data>
<data name="Duration_PMax_s" xml:space="preserve">
<value>Czas trwania Pmax [s]</value>
</data>
<data name="Closing_valve_Pump_off" xml:space="preserve">
<value>Zamnięcie zaworu zasilania, wyłączenie pompy</value>
</data>
<data name="Purchase_Order" xml:space="preserve">
<value>Zamówienie</value>
</data>
<data name="Ambient_humidity_" xml:space="preserve">
<value>Wilgotność względna otoczenia</value>
</data>
<data name="Ambient_pressure_" xml:space="preserve">
<value>Ciśnienie względne:</value>
</data>
<data name="Ambient_temperature_" xml:space="preserve">
<value>Temperatura otoczenia:</value>
</data>
<data name="Approval_" xml:space="preserve">
<value>Zatwierdzenie:</value>
</data>
<data name="Date_and_time_" xml:space="preserve">
<value>Data i czas:</value>
</data>
<data name="End" xml:space="preserve">
<value>Koniec</value>
</data>
<data name="AtTemperature_C" xml:space="preserve">
<value>@temperatura [degC]</value>
</data>
<data name="Density_kg_m3" xml:space="preserve">
<value>Gęstość [kg/m3]</value>
</data>
<data name="Density" xml:space="preserve">
<value>Gęstość</value>
</data>
<data name="Nr_meters_in_a_group" xml:space="preserve">
<value>Nr liczników w grupie</value>
</data>
<data name="End_Condition" xml:space="preserve">
<value>Stan końcowy</value>
</data>
<data name="Communication" xml:space="preserve">
<value>Połączenie</value>
</data>
<data name="Aux_" xml:space="preserve">
<value>Dodadkowy</value>
</data>
<data name="Main_" xml:space="preserve">
<value>Główny</value>
</data>
<data name="cold" xml:space="preserve">
<value>zimna</value>
</data>
<data name="hot" xml:space="preserve">
<value>gorąca</value>
</data>
<data name="Product_name" xml:space="preserve">
<value>Nazwa produktu</value>
</data>
<data name="Address" xml:space="preserve">
<value>Adres</value>
</data>
<data name="Approval_date" xml:space="preserve">
<value>Data zatwierdzenia</value>
</data>
<data name="Approval_ID" xml:space="preserve">
<value>ID Zatwierdzenia</value>
</data>
<data name="Approved_by" xml:space="preserve">
<value>Zatwierdzono</value>
</data>
<data name="Evaluate" xml:space="preserve">
<value>Ocena</value>
</data>
<data name="iPerl_Communication_in_progress" xml:space="preserve">
<value>Połączenie z iPERL w trakcie</value>
</data>
<data name="Language" xml:space="preserve">
<value>Język</value>
</data>
<data name="Available_Components_" xml:space="preserve">
<value>Dostępne elementy:</value>
</data>
<data name="Database_Settings" xml:space="preserve">
<value>Ustawienia bazy danych:</value>
</data>
<data name="About_Test_Bench_Framework" xml:space="preserve">
<value>O Framework stanowiska</value>
</data>
<data name="BuildDateStr" xml:space="preserve">
<value>Build Data _BUILD_Data_</value>
</data>
<data name="CopyrightStr" xml:space="preserve">
<value>Praw autorskie © 2013 - {0}</value>
</data>
<data name="Edit_User" xml:space="preserve">
<value>Edytuj użytkownika</value>
</data>
<data name="Groups" xml:space="preserve">
<value>Grupy</value>
</data>
<data name="An_unhandled_error_occured" xml:space="preserve">
<value>Wystąpił nieobsługiwany błąd </value>
</data>
<data name="IgnoreBtnText" xml:space="preserve">
<value>Wyłączyć</value>
</data>
<data name="Add_filter" xml:space="preserve">
<value>Dodać filtr</value>
</data>
<data name="Clear_filters" xml:space="preserve">
<value>Oczyścić filtr</value>
</data>
<data name="Execute_query" xml:space="preserve">
<value>Wykonaj zapytanie</value>
</data>
<data name="Export_query_results" xml:space="preserve">
<value>Eksport wyników zapytania</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Filtry</value>
</data>
<data name="Format_of_results" xml:space="preserve">
<value>Format wyników</value>
</data>
<data name="Load_filters" xml:space="preserve">
<value>Załaduj filtry</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>Wydrukuj wyniki</value>
</data>
<data name="Query_results" xml:space="preserve">
<value>Wyniki zapytania</value>
</data>
<data name="Results_Browser" xml:space="preserve">
<value>Przegląd wyników</value>
</data>
<data name="Save_filters" xml:space="preserve">
<value>Zachować filtry</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Ustawienia</value>
</data>
<data name="Test_benches" xml:space="preserve">
<value>Stanowiska pomiarowe</value>
</data>
<data name="RetryDatabaseText" xml:space="preserve">
<value>Powtórka</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>Wybrane wyniki:</value>
</data>
<data name="SingleBtnText" xml:space="preserve">
<value>Pojedynczy</value>
</data>
<data name="UnlockBtnText" xml:space="preserve">
<value>Odblokować</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Licznik wody</value>
</data>
<data name="Date" xml:space="preserve">
<value>Data</value>
</data>
<data name="From" xml:space="preserve">
<value>Od</value>
</data>
<data name="To" xml:space="preserve">
<value>Do</value>
</data>
<data name="Statistics" xml:space="preserve">
<value>Statystyka</value>
</data>
<data name="Columns" xml:space="preserve">
<value>Kolumny</value>
</data>
<data name="Rows" xml:space="preserve">
<value>Wiersze</value>
</data>
<data name="Select_a_filter" xml:space="preserve">
<value>Proszę wybrać filtr</value>
</data>
<data name="Error_displaying_results" xml:space="preserve">
<value>Błąd przy wyśiwetlaniu wyników</value>
</data>
<data name="All_files" xml:space="preserve">
<value>Wszystkie pliki</value>
</data>
<data name="Error_saving_file" xml:space="preserve">
<value>Błąd zapisu pliku:</value>
</data>
<data name="Error_serializing_filters" xml:space="preserve">
<value>Błąd szeregowania plików</value>
</data>
<data name="Query_files" xml:space="preserve">
<value>Pliki zapytania</value>
</data>
<data name="No_program_settings_found" xml:space="preserve">
<value>Nie znaleziono ustawień programu</value>
</data>
<data name="Using_default_settings" xml:space="preserve">
<value>Ustawienia domyslne</value>
</data>
<data name="Selected_language_not_supported" xml:space="preserve">
<value>Wybrany język jest nieobsługiwany</value>
</data>
<data name="Using_English" xml:space="preserve">
<value>Wykorzystuje język angielski</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Ostrzeżenie</value>
</data>
<data name="Count" xml:space="preserve">
<value>Odliczanie</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="Page_orientation" xml:space="preserve">
<value>Orientacja strony</value>
</data>
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
<value>Tak = pionowa, Nie = pozioma</value>
</data>
<data name="Print" xml:space="preserve">
<value>Drukuj</value>
</data>
</root>
+15
View File
@@ -795,4 +795,19 @@
<data name="Warning" xml:space="preserve">
<value>Warning</value>
</data>
<data name="Count" xml:space="preserve">
<value>Count</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="Page_orientation" xml:space="preserve">
<value>Page orientation</value>
</data>
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
<value>Yes = Portrait, No = Landscape</value>
</data>
<data name="Print" xml:space="preserve">
<value>Print</value>
</data>
</root>
+813
View File
@@ -0,0 +1,813 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Confirmation" xml:space="preserve">
<value>Подтверждение</value>
</data>
<data name="Do_you_want_to_save_the_procedure" xml:space="preserve">
<value>Хотите сохранить процедуру?</value>
</data>
<data name="Error" xml:space="preserve">
<value>Ошибка</value>
</data>
<data name="Error_loading_users_from_the_database" xml:space="preserve">
<value>Ошибка при загрузке пользователей из базы данных:</value>
</data>
<data name="Failed_to_create_a_sample_database" xml:space="preserve">
<value>Не удалось создать базу данных:</value>
</data>
<data name="Failed_to_export_the_database" xml:space="preserve">
<value>Не удалось экспортировать базу данных:</value>
</data>
<data name="Invalid_user_password_or_bench" xml:space="preserve">
<value>Неверный пользователь, пароль, или установка</value>
</data>
<data name="Test_bench" xml:space="preserve">
<value>Поверочная установка</value>
</data>
<data name="MaxChars" xml:space="preserve">
<value>(Макс. _X_ Буквенно-цифровых символов)</value>
</data>
<data name="close" xml:space="preserve">
<value>закрыть</value>
</data>
<data name="Diverter" xml:space="preserve">
<value>Клапан</value>
</data>
<data name="Emptying_valve" xml:space="preserve">
<value>Выпускной клапан</value>
</data>
<data name="Name" xml:space="preserve">
<value>Имя</value>
</data>
<data name="Reference" xml:space="preserve">
<value>Ссылка</value>
</data>
<data name="Reg_valve" xml:space="preserve">
<value>Рег. вентиль</value>
</data>
<data name="Balance" xml:space="preserve">
<value>Весы</value>
</data>
<data name="Duration_s" xml:space="preserve">
<value>Продолжительность [с]</value>
</data>
<data name="no" xml:space="preserve">
<value>нет</value>
</data>
<data name="New_bench_path_name" xml:space="preserve">
<value>PУстановка</value>
</data>
<data name="New_feeding_path_name" xml:space="preserve">
<value>PFeed</value>
</data>
<data name="New_output_path_name" xml:space="preserve">
<value>PQ</value>
</data>
<data name="New_procedure_name" xml:space="preserve">
<value>Процедура</value>
</data>
<data name="New_sensors_path_name" xml:space="preserve">
<value>PSens</value>
</data>
<data name="New_test_name" xml:space="preserve">
<value>Тест</value>
</data>
<data name="New_name_copy" xml:space="preserve">
<value> - Копировать</value>
</data>
<data name="Correction_g" xml:space="preserve">
<value>Коррекция [г]</value>
</data>
<data name="Nr" xml:space="preserve">
<value>№</value>
</data>
<data name="Mass_kg" xml:space="preserve">
<value>Масса [кг]</value>
</data>
<data name="AddBtnText" xml:space="preserve">
<value>Добавить</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Отмена</value>
</data>
<data name="CloseBtnText" xml:space="preserve">
<value>Закрыть</value>
</data>
<data name="LockBtnText" xml:space="preserve">
<value>Заблокировать</value>
</data>
<data name="RemoveBtnText" xml:space="preserve">
<value>Удалить</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
</data>
<data name="Correction_lph" xml:space="preserve">
<value>Коррекция [л/ч]</value>
</data>
<data name="Correction_mbar" xml:space="preserve">
<value>Коррекция [мбар]</value>
</data>
<data name="Flow_m3h" xml:space="preserve">
<value>Расход [м3/ч]</value>
</data>
<data name="Invalid_username_or_password" xml:space="preserve">
<value>Неправильное имя пользователя или пароль</value>
</data>
<data name="CopyBtnText" xml:space="preserve">
<value>Копировать</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Вниз</value>
</data>
<data name="EditBtnText" xml:space="preserve">
<value>Редактировать</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Вверх</value>
</data>
<data name="NoDatabaseMsg" xml:space="preserve">
<value>Не удается подключиться к базе данных.</value>
</data>
<data name="ConfigureDatabaseText" xml:space="preserve">
<value>Тестовая конфигурация установки (требуется пароль)</value>
</data>
<data name="ExitBtnText" xml:space="preserve">
<value>Выход</value>
</data>
<data name="Enter_password" xml:space="preserve">
<value>Введите пароль</value>
</data>
<data name="Invalid_password" xml:space="preserve">
<value>Неверный пароль</value>
</data>
<data name="Bench_name_conflict_Use_another_name_pls" xml:space="preserve">
<value>Имя поверочной установки неверно, используйте другое имя, пожалуйста</value>
</data>
<data name="DB_was_successfully_created" xml:space="preserve">
<value>База данных была успешно создана!</value>
</data>
<data name="DB_will_be_overwritten" xml:space="preserve">
<value>База данных будет перезаписана</value>
</data>
<data name="Do_you_want_to_proceed" xml:space="preserve">
<value>Вы хотите продолжить?</value>
</data>
<data name="Notification" xml:space="preserve">
<value>Уведомление</value>
</data>
<data name="NoBenchMsg" xml:space="preserve">
<value>Нет поверочной установки в конфигурации программы.</value>
</data>
<data name="DescriptionColHdr" xml:space="preserve">
<value>Описание</value>
</data>
<data name="Procedure" xml:space="preserve">
<value>Процедура</value>
</data>
<data name="Test" xml:space="preserve">
<value>Тест</value>
</data>
<data name="Corrected" xml:space="preserve">
<value>Исправлено</value>
</data>
<data name="Measured" xml:space="preserve">
<value>Измерено</value>
</data>
<data name="Bench_is_not_running" xml:space="preserve">
<value>Поверочная установка не запущена, однако вы можете изменить настройки, чтобы решить эту проблему.</value>
</data>
<data name="Emptying_chdr" xml:space="preserve">
<value>Выпуск</value>
</data>
<data name="Bench_chdr" xml:space="preserve">
<value>Установка</value>
</data>
<data name="Err_cor_neg_pct_chdr" xml:space="preserve">
<value>Err. cor. - [%]</value>
</data>
<data name="Err_cor_pos_pct_chdr" xml:space="preserve">
<value>Err. cor. +[%]</value>
</data>
<data name="Err_limit_neg_pct_chdr" xml:space="preserve">
<value>Err. Limit - [%]</value>
</data>
<data name="Err_limit_pos_pct_chdr" xml:space="preserve">
<value>Err. Limit + [%]</value>
</data>
<data name="Feeding_chdr" xml:space="preserve">
<value>Feeding</value>
</data>
<data name="Red_type_chdr" xml:space="preserve">
<value>Red. type</value>
</data>
<data name="Error_while_creating_DB_Reason" xml:space="preserve">
<value>Ошибка при создании базы данных. Причина:</value>
</data>
<data name="Metrology" xml:space="preserve">
<value>Метрология</value>
</data>
<data name="_offline" xml:space="preserve">
<value>(не в сети)</value>
</data>
<data name="Administrator" xml:space="preserve">
<value>Администратор</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Специалист по калибровке</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Руководитель лаборатории</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Специалист по техобслуживанию</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Метролог</value>
</data>
<data name="Close_emptying_valve" xml:space="preserve">
<value>Закрыть выпускной клапан</value>
</data>
<data name="Get_mass_of_water_in_the_tank" xml:space="preserve">
<value>Получить массу воды в резервуаре</value>
</data>
<data name="Ignore" xml:space="preserve">
<value>Отклонить</value>
</data>
<data name="Loading_the_procedure" xml:space="preserve">
<value>Процедура загрузки</value>
</data>
<data name="Make_tank_empty" xml:space="preserve">
<value>Оборожнить бак</value>
</data>
<data name="Measure_the_mass" xml:space="preserve">
<value>Измерьте массу</value>
</data>
<data name="Ready" xml:space="preserve">
<value>Готов</value>
</data>
<data name="BackBtnText" xml:space="preserve">
<value>&lt; Назад</value>
</data>
<data name="FinishBtnText" xml:space="preserve">
<value>Завершить</value>
</data>
<data name="NextBtnText" xml:space="preserve">
<value>Дальше &gt;</value>
</data>
<data name="Flow_selection" xml:space="preserve">
<value>Выбор расхода</value>
</data>
<data name="Method_chdr" xml:space="preserve">
<value>Метод испытания</value>
</data>
<data name="RelativeQfrom" xml:space="preserve">
<value>Относительный Q от</value>
</data>
<data name="RelativeQto" xml:space="preserve">
<value>Относительный Q до</value>
</data>
<data name="Combined_meters" xml:space="preserve">
<value>Комбинированные счетчики</value>
</data>
<data name="DetectionThresholdPct" xml:space="preserve">
<value>Порог [%]</value>
</data>
<data name="RateOfChangePct" xml:space="preserve">
<value>Скорость изменения [%]</value>
</data>
<data name="Component" xml:space="preserve">
<value>Компонент</value>
</data>
<data name="_none_" xml:space="preserve">
<value>&lt;нет&gt;</value>
</data>
<data name="Method_selection" xml:space="preserve">
<value>Выбор метода испытаний</value>
</data>
<data name="Clear_results" xml:space="preserve">
<value>Очистить Результаты</value>
</data>
<data name="Configure" xml:space="preserve">
<value>Конфигурировать</value>
</data>
<data name="Arrangement_of_meters" xml:space="preserve">
<value>Расположение испытуемых счетчиков</value>
</data>
<data name="Arrangement_of_tests" xml:space="preserve">
<value>Расположение испытаний</value>
</data>
<data name="Horizontally" xml:space="preserve">
<value>Горизонтально</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>Конфигурация</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="ClearBtnText" xml:space="preserve">
<value>Очистить</value>
</data>
<data name="Emptying_tank" xml:space="preserve">
<value>Опорожнение бака</value>
</data>
<data name="Measuring_the_weight" xml:space="preserve">
<value>Измерение веса</value>
</data>
<data name="Emptying_i_n" xml:space="preserve">
<value>Слив ({0}: шаг {1} / {2})</value>
</data>
<data name="Activity" xml:space="preserve">
<value>Активность</value>
</data>
<data name="Approval_info" xml:space="preserve">
<value>Информация об утверждении</value>
</data>
<data name="Metrological_class" xml:space="preserve">
<value>Метрологический класс</value>
</data>
<data name="Producer" xml:space="preserve">
<value>Производитель</value>
</data>
<data name="Printer" xml:space="preserve">
<value>Принтер</value>
</data>
<data name="Version" xml:space="preserve">
<value>Версия</value>
</data>
<data name="nothing_to_configure" xml:space="preserve">
<value>&lt;нечего настраивать&gt;</value>
</data>
<data name="Fill_with_water" xml:space="preserve">
<value>Заполнить установку водой?</value>
</data>
<data name="NoBtn" xml:space="preserve">
<value>Нет</value>
</data>
<data name="Question" xml:space="preserve">
<value>Вопрос</value>
</data>
<data name="Bench_parameters" xml:space="preserve">
<value>Установка параметров</value>
</data>
<data name="Connection_string" xml:space="preserve">
<value>Строка подключения БД</value>
</data>
<data name="Create_DB" xml:space="preserve">
<value>Создание БД</value>
</data>
<data name="Database_type" xml:space="preserve">
<value>Тип БД</value>
</data>
<data name="Logging" xml:space="preserve">
<value>Логирование</value>
</data>
<data name="Mode" xml:space="preserve">
<value>Режим</value>
</data>
<data name="NewTabBtnText" xml:space="preserve">
<value>Новая вкладка</value>
</data>
<data name="New_transition_name" xml:space="preserve">
<value>Новое имя перехода</value>
</data>
<data name="Detection_completed" xml:space="preserve">
<value>Обнаружение завершено</value>
</data>
<data name="Emergency_STOP" xml:space="preserve">
<value>Аварийная остановка</value>
</data>
<data name="Add" xml:space="preserve">
<value>&amp;Добавить &gt;</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Доступные результаты</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; &amp;Удалить</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>&lt;&lt; Удалить все</value>
</data>
<data name="Message" xml:space="preserve">
<value>Сообщение</value>
</data>
<data name="dflt" xml:space="preserve">
<value>dflt</value>
</data>
<data name="Detection_failed" xml:space="preserve">
<value>Обнаружение не удалось</value>
</data>
<data name="Camera_error" xml:space="preserve">
<value>Ошибка камеры</value>
</data>
<data name="remaining_time" xml:space="preserve">
<value>оставшееся время</value>
</data>
<data name="LessBtnText" xml:space="preserve">
<value>Меньше</value>
</data>
<data name="MoreBtnText" xml:space="preserve">
<value>Больше</value>
</data>
<data name="Changes_will_be_lost_Do_you_want_to_proceed" xml:space="preserve">
<value>Изменения будут потеряны. Вы хотите продолжить?</value>
</data>
<data name="Flowmeter" xml:space="preserve">
<value>Расходомер</value>
</data>
<data name="CombinedBtnText" xml:space="preserve">
<value>Комбинированный</value>
</data>
<data name="Device" xml:space="preserve">
<value>Устройство</value>
</data>
<data name="PrinterBtnText" xml:space="preserve">
<value>Принтер</value>
</data>
<data name="Aux_Water_Meter" xml:space="preserve">
<value>Доп.счетчик воды</value>
</data>
<data name="Aux_Water_Meter_State" xml:space="preserve">
<value>Статус доп.счетчика</value>
</data>
<data name="Data" xml:space="preserve">
<value>Данные</value>
</data>
<data name="End_State" xml:space="preserve">
<value>Конечное состояние</value>
</data>
<data name="Main_Water_Meter" xml:space="preserve">
<value>Главный счетчик воды</value>
</data>
<data name="Main_Water_Meter_State" xml:space="preserve">
<value>Статус главного счетчика</value>
</data>
<data name="Protocol" xml:space="preserve">
<value>Протокол</value>
</data>
<data name="Serial_Number" xml:space="preserve">
<value>Серийный номер</value>
</data>
<data name="Aux_WM_SerialNr" xml:space="preserve">
<value>Сер. № доп. счетчика</value>
</data>
<data name="Main_WM_SerialNr" xml:space="preserve">
<value>Сер. № главн. счетчика</value>
</data>
<data name="Adjustment_in_progress" xml:space="preserve">
<value>Настройка выполняется</value>
</data>
<data name="Error_pct" xml:space="preserve">
<value>Погрешность [%]</value>
</data>
<data name="Duration_Leak_s" xml:space="preserve">
<value>Продолжительность расхода [с]</value>
</data>
<data name="Duration_PMax_s" xml:space="preserve">
<value>Продолжительность Pмакс [с]</value>
</data>
<data name="Closing_valve_Pump_off" xml:space="preserve">
<value>Закрытие впускного клапана, выключение насоса</value>
</data>
<data name="Purchase_Order" xml:space="preserve">
<value>Заказ</value>
</data>
<data name="Ambient_humidity_" xml:space="preserve">
<value>Относительная влажность окружающей среды:</value>
</data>
<data name="Ambient_pressure_" xml:space="preserve">
<value>Относительное давление: </value>
</data>
<data name="Ambient_temperature_" xml:space="preserve">
<value>Температура окружающей среды: </value>
</data>
<data name="Approval_" xml:space="preserve">
<value>Утверждение: </value>
</data>
<data name="Date_and_time_" xml:space="preserve">
<value>Дата и время: </value>
</data>
<data name="End" xml:space="preserve">
<value>Конец</value>
</data>
<data name="AtTemperature_C" xml:space="preserve">
<value>температура [degC]</value>
</data>
<data name="Density_kg_m3" xml:space="preserve">
<value>Плотность [кг/м3]</value>
</data>
<data name="Density" xml:space="preserve">
<value>Плотность</value>
</data>
<data name="Nr_meters_in_a_group" xml:space="preserve">
<value>№ счетчиков в группе</value>
</data>
<data name="End_Condition" xml:space="preserve">
<value>Конечное состояние</value>
</data>
<data name="Communication" xml:space="preserve">
<value>Соединение</value>
</data>
<data name="Aux_" xml:space="preserve">
<value>Доп.</value>
</data>
<data name="Main_" xml:space="preserve">
<value>Главн:</value>
</data>
<data name="cold" xml:space="preserve">
<value>холодный</value>
</data>
<data name="hot" xml:space="preserve">
<value>горячий</value>
</data>
<data name="Product_name" xml:space="preserve">
<value>Наименование продукта</value>
</data>
<data name="Address" xml:space="preserve">
<value>Адрес</value>
</data>
<data name="Approval_date" xml:space="preserve">
<value>Дата утверждения</value>
</data>
<data name="Approval_ID" xml:space="preserve">
<value>ID Утверждения </value>
</data>
<data name="Approved_by" xml:space="preserve">
<value>Утверждено</value>
</data>
<data name="Evaluate" xml:space="preserve">
<value>Оценка</value>
</data>
<data name="iPerl_Communication_in_progress" xml:space="preserve">
<value>Осуществляется связь с iPerl </value>
</data>
<data name="Language" xml:space="preserve">
<value>Язык</value>
</data>
<data name="Available_Components_" xml:space="preserve">
<value>Доступные компоненты:</value>
</data>
<data name="Database_Settings" xml:space="preserve">
<value>Настройки Базы данных</value>
</data>
<data name="About_Test_Bench_Framework" xml:space="preserve">
<value>О Framework поверочной установки</value>
</data>
<data name="BuildDateStr" xml:space="preserve">
<value>Build Data _BUILD_Data_</value>
</data>
<data name="CopyrightStr" xml:space="preserve">
<value>Copyright © 2013 - {0}</value>
</data>
<data name="Edit_User" xml:space="preserve">
<value>Редактировать пользователя</value>
</data>
<data name="Groups" xml:space="preserve">
<value>Группы</value>
</data>
<data name="An_unhandled_error_occured" xml:space="preserve">
<value>Произошла необрабатываемая ошибка</value>
</data>
<data name="IgnoreBtnText" xml:space="preserve">
<value>Отклонить</value>
</data>
<data name="Add_filter" xml:space="preserve">
<value>Добавить фильтр</value>
</data>
<data name="Clear_filters" xml:space="preserve">
<value>Очистить фильтры</value>
</data>
<data name="Execute_query" xml:space="preserve">
<value>Выполнить запрос</value>
</data>
<data name="Export_query_results" xml:space="preserve">
<value>Экспорт результатов запроса</value>
</data>
<data name="Filters" xml:space="preserve">
<value>Фильтры</value>
</data>
<data name="Format_of_results" xml:space="preserve">
<value>Формат результатов</value>
</data>
<data name="Load_filters" xml:space="preserve">
<value>Загрузка фильтров</value>
</data>
<data name="Print_query_results" xml:space="preserve">
<value>Печать результатов</value>
</data>
<data name="Query_results" xml:space="preserve">
<value>Результаты запроса</value>
</data>
<data name="Results_Browser" xml:space="preserve">
<value>Результаты обозревателя</value>
</data>
<data name="Save_filters" xml:space="preserve">
<value>Сохранить фильтры</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Установки</value>
</data>
<data name="Test_benches" xml:space="preserve">
<value>Поверочные установки</value>
</data>
<data name="RetryDatabaseText" xml:space="preserve">
<value>Повтор</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>Выбанные результаты</value>
</data>
<data name="SingleBtnText" xml:space="preserve">
<value>Единый</value>
</data>
<data name="UnlockBtnText" xml:space="preserve">
<value>Разблокировать</value>
</data>
<data name="Water_Meter" xml:space="preserve">
<value>Счетчик воды</value>
</data>
<data name="Date" xml:space="preserve">
<value>Дата</value>
</data>
<data name="From" xml:space="preserve">
<value>От</value>
</data>
<data name="To" xml:space="preserve">
<value>До</value>
</data>
<data name="Statistics" xml:space="preserve">
<value>Статистика</value>
</data>
<data name="Columns" xml:space="preserve">
<value>Столбцы</value>
</data>
<data name="Rows" xml:space="preserve">
<value>Строки</value>
</data>
<data name="Select_a_filter" xml:space="preserve">
<value>Выберите фильтр</value>
</data>
<data name="Error_displaying_results" xml:space="preserve">
<value>Ошибка отображения результатов</value>
</data>
<data name="All_files" xml:space="preserve">
<value>Все файлы</value>
</data>
<data name="Error_saving_file" xml:space="preserve">
<value>Ошибка сохранения файла</value>
</data>
<data name="Error_serializing_filters" xml:space="preserve">
<value>Ошибка фильтров сериализации</value>
</data>
<data name="Query_files" xml:space="preserve">
<value>Запрашиваемые файлы</value>
</data>
<data name="No_program_settings_found" xml:space="preserve">
<value>Не найдены настройки программы</value>
</data>
<data name="Using_default_settings" xml:space="preserve">
<value>Использовать настройки по умолчанию</value>
</data>
<data name="Selected_language_not_supported" xml:space="preserve">
<value>Выбранный язык не поддерживается.</value>
</data>
<data name="Using_English" xml:space="preserve">
<value>Использование Английского языка</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Предупреждение</value>
</data>
<data name="Count" xml:space="preserve">
<value>Подсчет</value>
</data>
<data name="Format" xml:space="preserve">
<value>Формат</value>
</data>
<data name="Page_orientation" xml:space="preserve">
<value>Ориентация страницы</value>
</data>
<data name="Yes_Portrait_No_Landscape" xml:space="preserve">
<value>Да = Книжная, No = Альбомная</value>
</data>
<data name="Print" xml:space="preserve">
<value>Печатать</value>
</data>
</root>
+45
View File
@@ -636,6 +636,15 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Count.
/// </summary>
internal static string Count {
get {
return ResourceManager.GetString("Count", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Create DB.
/// </summary>
@@ -1167,6 +1176,15 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Format.
/// </summary>
internal static string Format {
get {
return ResourceManager.GetString("Format", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Format of results.
/// </summary>
@@ -1698,6 +1716,24 @@ namespace ResultsBrowser.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Page orientation.
/// </summary>
internal static string Page_orientation {
get {
return ResourceManager.GetString("Page_orientation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Print.
/// </summary>
internal static string Print {
get {
return ResourceManager.GetString("Print", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Print query results.
/// </summary>
@@ -2093,5 +2129,14 @@ namespace ResultsBrowser.Resources {
return ResourceManager.GetString("Water_Meter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yes = Portrait, No = Landscape.
/// </summary>
internal static string Yes_Portrait_No_Landscape {
get {
return ResourceManager.GetString("Yes_Portrait_No_Landscape", resourceCulture);
}
}
}
}
+9 -21
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MALTA_WSD25</DefineConstants>
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MALTA_WSD25</DefineConstants>
<DefineConstants>TRACE;MUNICH;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -144,21 +144,15 @@
<DependentUpon>StatisticsOptionsDlg.cs</DependentUpon>
</Compile>
<Compile Include="LocalSettings.cs" />
<Compile Include="MainWnd.cs">
<SubType>Form</SubType>
<Compile Include="Output\Printers\QueryResults\QueryResultsPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MainWnd.Designer.cs">
<DependentUpon>MainWnd.cs</DependentUpon>
<Compile Include="Output\Printers\Statistics\StatisticsPrintDocument.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="FiltersConfig.cs" />
<Compile Include="RBrowserWnd.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RBrowserWnd.Designer.cs">
<DependentUpon>RBrowserWnd.cs</DependentUpon>
</Compile>
<Compile Include="Resources\Strings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -203,9 +197,6 @@
<EmbeddedResource Include="Forms\StatisticsOptionsDlg.resx">
<DependentUpon>StatisticsOptionsDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainWnd.resx">
<DependentUpon>MainWnd.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -216,15 +207,14 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="RBrowserWnd.resx">
<DependentUpon>RBrowserWnd.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings1.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.ru.resx" />
<EmbeddedResource Include="ResultsBrowserWnd.resx">
<DependentUpon>ResultsBrowserWnd.cs</DependentUpon>
</EmbeddedResource>
@@ -249,9 +239,7 @@
<Name>Results</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Printers\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
+100 -35
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NHibernate;
using Results.Entities;
@@ -17,23 +12,29 @@ namespace ResultsBrowser
{
const string OpenFileDlg_SaveFileDlg_Filter = "{0} (*.qry)|*.qry|{1} (*.*)|*.*";
string[] args;
IList<Filters.IFilter> filters; /// Filters and the UI of filters
FiltersConfig filtersConfig; /// Serializable configuration of filters and displayed results
IList<WaterMeter> waterMeters;
public ResultsBrowserWnd()
DateTime timePeriodStart;
DateTime timePeriodEnd;
public ResultsBrowserWnd(string[] args)
{
InitializeComponent();
filters = new List<Filters.IFilter>();
filtersConfig = new FiltersConfig();
}
this.args = args;
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
}
private void ResultsBrowserWnd_Load(object sender, EventArgs e)
{
Text = string.Format("{0} ver.{1}", Strings.Results_Browser, Program.Version);
ResultsBrowser.LocalSettings ls = Program.LocalSettings;
Width = (ls.MainWndWidth > 0) ? ls.MainWndWidth : 1000;
Height = (ls.MainWndHeight > 0) ? ls.MainWndHeight : 750;
@@ -48,6 +49,19 @@ namespace ResultsBrowser
checkBox1.Checked = Program.LocalSettings.Bench1Selected;
checkBox2.Checked = Program.LocalSettings.Bench2Selected;
checkBox3.Checked = Program.LocalSettings.Bench3Selected;
if (args.Length == 1 && args[0].IndexOf(".qry") == args[0].Length - 4)
{
LoadConfigFromFile(args[0]);
}
else if (!string.IsNullOrEmpty(Program.LocalSettings.LastConfigFileName))
{
LoadConfigFromFile(Program.LocalSettings.LastConfigFileName);
}
else
{
Text = string.Format("{0} ver.{1}", Strings.Results_Browser, Program.Version);
}
}
void RedrawTestBenches()
@@ -61,6 +75,13 @@ namespace ResultsBrowser
checkBox3.Visible = !string.IsNullOrEmpty(checkBox3.Text);
}
string BenchName()
{
return checkBox1.Checked ? Program.LocalSettings.Bench1
: checkBox2.Checked ? Program.LocalSettings.Bench2
: Program.LocalSettings.Bench3;
}
void Localize()
{
filtersGroupBox.Text = Strings.Filters;
@@ -121,22 +142,32 @@ namespace ResultsBrowser
dlg.Filter = string.Format("{0} (*.qry)|*.qry|{1} (*.*)|*.*", Strings.Query_files, Strings.All_files);
if (dlg.ShowDialog() == DialogResult.OK)
{
FiltersConfig localFiltersConfig = FiltersConfig.Load(dlg.FileName);
if (localFiltersConfig != null)
{
filtersConfig = localFiltersConfig;
LoadConfigFromFile(dlg.FileName);
}
}
filters.Clear();
filtersFlowLayoutPanel.Controls.Clear();
///
for (int i = 0; i < filtersConfig.FiltersCount; i++)
{
Filters.IFilter filter = Factory.LoadFilter(filtersConfig.FilterID[i], filtersConfig.FilterData[i]);
filters.Add(filter);
filtersFlowLayoutPanel.Controls.Add(filter.GetFilterUI());
}
void LoadConfigFromFile(string fileName)
{
FiltersConfig localFiltersConfig = FiltersConfig.Load(fileName);
if (localFiltersConfig != null)
{
filtersConfig = localFiltersConfig;
filters.Clear();
filtersFlowLayoutPanel.Controls.Clear();
///
for (int i = 0; i < filtersConfig.FiltersCount; i++)
{
Filters.IFilter filter = Factory.LoadFilter(filtersConfig.FilterID[i], filtersConfig.FilterData[i]);
filters.Add(filter);
filtersFlowLayoutPanel.Controls.Add(filter.GetFilterUI());
}
}
}
Program.LocalSettings.LastConfigFileName = fileName;
Program.LocalSettings.Save();
Text = string.Format("{0} ver.{1} ({2})", Strings.Results_Browser, Program.Version, Program.LocalSettings.LastConfigFileName);
}
private void saveConfigBtn_Click(object sender, EventArgs e)
@@ -159,12 +190,20 @@ namespace ResultsBrowser
if (dlg.ShowDialog() == DialogResult.OK)
{
filtersConfig.Save(dlg.FileName);
Program.LocalSettings.LastConfigFileName = dlg.FileName;
Program.LocalSettings.Save();
Text = string.Format("{0} ver.{1} ({2})", Strings.Results_Browser, Program.Version, Program.LocalSettings.LastConfigFileName);
}
}
}
private void executeQueryBtn_Click(object sender, EventArgs e)
{
timePeriodStart = new DateTime(0);
timePeriodEnd = new DateTime(0);
try
{
foreach (var filter in filters) filter.UI2Data(); /// Update filter data
@@ -181,6 +220,11 @@ namespace ResultsBrowser
foreach (var filter in filters)
{
if (filter is DateFilter)
{
timePeriodStart = (filter as DateFilter).From;
timePeriodEnd = (filter as DateFilter).To;
}
waterMeters2 = filter.ExecuteQuery(sessions, waterMeters);
waterMeters = waterMeters2;
}
@@ -229,13 +273,10 @@ namespace ResultsBrowser
private void formatOfResultsBtn_Click(object sender, EventArgs e)
{
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg()
{
MetersKind = Config.Entities.MetersKind.Single,
SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems),
AvailableItems = new List<Results.WMeterRsltItemSpec>()
};
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
dlg.AvailableItems = new List<Results.WMeterRsltItemSpec>();
foreach (var v in Results.WMeterRsltItemSpec.AllItems) dlg.AvailableItems.Add(v);
if (dlg.ShowDialog() == DialogResult.OK)
@@ -255,26 +296,50 @@ namespace ResultsBrowser
{
if (waterMeters == null || waterMeters.Count == 0) return;
#if MUNICH
foreach (var wm in waterMeters)
{
new Results.Output.Printers.Munich.MunichPrintDocument("", wm, Config.Entities.PageOrientation.Portrait).Print();
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
}
}
#elif CEVAK_PT40_272
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();
}
#endif
}
private void statisticsBtn_Click(object sender, EventArgs e)
{
if (waterMeters == null || waterMeters.Count == 0) return;
IList<Results.WMeterRsltItemSpec> items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
///
/// Enter options
///
Forms.StatisticsOptionsDlg dlg = new Forms.StatisticsOptionsDlg();
if (dlg.ShowDialog() != DialogResult.OK) return;
Forms.StatisticsOptionsDlg optionsDlg = new Forms.StatisticsOptionsDlg(items);
if (optionsDlg.ShowDialog() != DialogResult.OK) return;
///
/// Calculate statistics
///
Forms.StatisticsDlg statisticsDlg = new Forms.StatisticsDlg(waterMeters, dlg.TwoDim, dlg.RowItemID, dlg.ColumnItemID, dlg.RowTestSpecifier, dlg.ColumnTestSpecifier);
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);
statisticsDlg.ShowDialog();
}
}
+28
View File
@@ -16,6 +16,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResultsBrowser", "ResultsBr
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceTest", "DeviceTest\DeviceTest.csproj", "{6D3384DC-4638-4A92-91A8-F39D900377C6}"
ProjectSection(ProjectDependencies) = postProject
{439D0878-C76E-452B-B17D-209A89E91D36} = {439D0878-C76E-452B-B17D-209A89E91D36}
{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB} = {9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dirichlet.Numerics", "Dirichlet.Numerics\Dirichlet.Numerics.csproj", "{439D0878-C76E-452B-B17D-209A89E91D36}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Users", "Users\Users.csproj", "{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -83,6 +91,26 @@ Global
{6D3384DC-4638-4A92-91A8-F39D900377C6}.Release|Mixed Platforms.Build.0 = Release|x86
{6D3384DC-4638-4A92-91A8-F39D900377C6}.Release|x86.ActiveCfg = Release|x86
{6D3384DC-4638-4A92-91A8-F39D900377C6}.Release|x86.Build.0 = Release|x86
{439D0878-C76E-452B-B17D-209A89E91D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Debug|x86.ActiveCfg = Debug|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Release|Any CPU.Build.0 = Release|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{439D0878-C76E-452B-B17D-209A89E91D36}.Release|x86.ActiveCfg = Release|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Debug|x86.ActiveCfg = Debug|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Release|Any CPU.Build.0 = Release|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -90,6 +90,12 @@ namespace TBF.BenchControl.Ambient.Comet
return;
}
if (serialPort == null)
{
log.ErrorFormat("{0} - RunDeviceBefore() - serial port closed", Name);
return;
}
try
{
int receivedBytes = serialPort.BytesToRead;
@@ -139,6 +145,12 @@ namespace TBF.BenchControl.Ambient.Comet
return;
}
if (serialPort == null)
{
log.ErrorFormat("{0} - RunDeviceAfter() - serial port closed", Name);
return;
}
try
{
/// Each 10 seconds
@@ -178,7 +190,11 @@ namespace TBF.BenchControl.Ambient.Comet
/// <summary>Stop this device</summary>
public void StopDevice()
{
if (serialPort != null) serialPort.Close();
if (serialPort != null)
{
serialPort.Close();
serialPort = null;
}
}
///
+10 -8
View File
@@ -12,10 +12,11 @@ namespace TBF.BenchControl
public string Name;
public float Qfrom;
public float Qto;
public ITempMeter TempIn;
public ITempMeter TempOut;
public IPressureMeter PressIn;
public IPressureMeter PressOut;
public ITempMeter TempMtrUp;
public ITempMeter TempMtrDown;
public IPressureMeter PressMtrUp;
public IPressureMeter PressMtrDown;
public IPressureMeter PressMtrDelta;
public IValve StopBFValve;
public IList<IValve> ValvesOpen;
public IList<IValve> ValvesClose;
@@ -35,10 +36,11 @@ namespace TBF.BenchControl
{
Qfrom = entity.Qfrom;
Qto = entity.Qto;
TempIn = TbfComponents.FindComponent(entity.TempIn, components) as ITempMeter;
TempOut = TbfComponents.FindComponent(entity.TempOut, components) as ITempMeter;
PressIn = TbfComponents.FindComponent(entity.PressIn, components) as IPressureMeter;
PressOut = TbfComponents.FindComponent(entity.PressOut, components) as IPressureMeter;
TempMtrUp = TbfComponents.FindComponent(entity.TempMtrUp, components) as ITempMeter;
TempMtrDown = TbfComponents.FindComponent(entity.TempMtrDown, components) as ITempMeter;
PressMtrUp = TbfComponents.FindComponent(entity.PressMtrUp, components) as IPressureMeter;
PressMtrDown = TbfComponents.FindComponent(entity.PressMtrDown, components) as IPressureMeter;
PressMtrDelta = TbfComponents.FindComponent(entity.PressMtrDelta, components) as IPressureMeter;
StopBFValve = TbfComponents.FindComponent(entity.StopBFValve, components) as IValve;
string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' });
@@ -1,115 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.Cameras.CameraRoi
{
/// <summary>
/// IdcCamera object represents all IDC cameras.
/// Camera ID is an argument of most methods.
/// </summary>
public class CameraRoi : ComponentBase, GenericDevices.ICameraRoi, GenericDevices.IRegisterReader
{
private static readonly ILog log = LogManager.GetLogger(typeof(CameraRoi));
public override string ToString() { return string.Format("CameraRoi({0})", Cfg.ToString(1)); }
readonly CameraRoiCfg cameraRoiCfg;
readonly GenericDevices.ICamera camera;
public GenericDevices.ICamera Camera { get { return camera; } }
public double PulsesPerLtr { get { return (double)cameraRoiCfg.ProcParams.GradPerLtr; } }
public double LtrsPerPulse { get { return ltrsPerPulse; } }
readonly double ltrsPerPulse;
public int WMPulses { get { return wmPulses; } }
public int WMRefPulses { get { return wmRefPulses; } }
public double WMVolume { get { return ltrsPerPulse * (double)wmPulses; } }
public int wmPulses;
public int wmRefPulses;
public CameraRoi()
{
}
public CameraRoi(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
cameraRoiCfg = cfg as CameraRoiCfg;
ltrsPerPulse = (PulsesPerLtr <= float.Epsilon) ? 0 : (1 / PulsesPerLtr);
if (cfg.DebugLevel != DebugMode.Off)
{
camera = TbfComponents.FindComponent(cfg.ParentName, components) as GenericDevices.ICamera;
if ((camera == null) && (cfg.DebugLevel != DebugMode.Inherit))
{
throw new Exception("Cannot find " + Name + " parent");
}
}
log.Debug(this.ToString());
}
public void Clear()
{
wmPulses = 0;
wmRefPulses = 0;
}
public void TestCompleted()
{
/// TODO: Implement
}
/// <summary>
/// Events: Event.ReadRegisterDone, Event.Error
/// </summary>
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
/// <returns>ReadWaterMeter instance reference casted to IOperaton</returns>
public IOperation ReadRegisterOp()
{
return new ReadRegisterOp(this);
}
/// <summary>
/// Watermeter wheel/arrow detection process.
/// </summary>
/// <param name="roiId">Region of interest (1..4)</param>
/// <returns>Reference to operation object instance</returns>
public IOperation DetectOp()
{
RoiProcedureParams pp = cameraRoiCfg.ProcParams;
return camera.DetectOp(cameraRoiCfg.RoiNr,
new Cameras.IdcCamera.Command.Detect(cameraRoiCfg.RoiNr, 0, pp.IRoiX, pp.IRoiY, pp.IRoiW, pp.IRoiH,
pp.CX, pp.CY, pp.ORoiW, pp.ORoiH, pp.R1, pp.R2, pp.R3,
pp.Ang1, pp.Ang2, pp.AngStep, pp.CCW, (pp.CCW ? -30 : 30),
pp.SequenceLen, pp.SequenceTiming, pp.BackgroundCorr,
pp.BrightnessRoi * camera.Brightness));
}
/// <summary>
/// Watermeter wheel/arrow angle measurement process.
/// </summary>
/// <param name="roiId">Region of interest (1..4)</param>
/// <returns>Reference to operation object instance</returns>
public IOperation MeasureOp()
{
RoiProcedureParams pp = cameraRoiCfg.ProcParams;
return camera.MeasureOp(cameraRoiCfg.RoiNr,
new Cameras.IdcCamera.Command.Measure(cameraRoiCfg.RoiNr, true, 0, pp.IRoiX, pp.IRoiY, pp.IRoiW, pp.IRoiH,
pp.CX, pp.CY, pp.ORoiW, pp.ORoiH, pp.MinMvmt, pp.MaxMvmt,
pp.BrightnessRoi * camera.Brightness));
}
}
}
@@ -1,60 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Cameras.CameraRoi
{
public class CameraRoiCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponentCfgCtrl GetControl() { return new CameraRoiCfgCtrl(); }
///
/// Serialized parameters
///
public int RoiNr; /// ROI number 1..4
///
/// Procedure parameters
///
[XmlIgnore]
public RoiProcedureParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure)
{
RoiProcedureParams procParams = new RoiProcedureParams();
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors
CameraRoiCfg()
{
Name = "ROI";
ParentName = "Idc";
ProcParams = new RoiProcedureParams();
RoiNr = 1;
}
public CameraRoiCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Roi={2}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
RoiNr);
}
}
}
@@ -1,26 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Cameras.CameraRoi
{
public class CameraRoiFactory : IComponentFactory
{
public string ClassName { get { return "CameraROI"; } }
public void ResetStaticProperties() { CameraRoi.ResetStaticProperties(); }
public IComponent DummyComponent() { return new CameraRoi(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new CameraRoi(cfg, components); }
public IComponentCfg DefaultConfig() { return new CameraRoiCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(CameraRoiCfg), component, this);
}
}
}
@@ -1,59 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using log4net;
using TBF.Boxes;
namespace TBF.BenchControl.Cameras.CameraRoi
{
public class ReadRegisterOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadRegisterOp));
public override string ToString() { return string.Format("ReadRegisterOp({0})", cameraRoi.Cfg.Name); }
/// Set by the constructor
readonly CameraRoi cameraRoi;
readonly BenchControl.Cameras.IdcCamera.IdcCamera camera;
/// <summary>
/// Events: Event.ReadRegisterDone or Event.Error
/// </summary>
/// <param name="reader">Register reader reference</param>
/// <param name="pulses">Reference to a field with the water meter pulses</param>
public ReadRegisterOp(CameraRoi cameraRoi)
{
this.cameraRoi = cameraRoi;
if (cameraRoi == null) throw new ArgumentNullException("reader is null or it is not IdcCamera");
camera = cameraRoi.Camera as BenchControl.Cameras.IdcCamera.IdcCamera;
log.Debug(this.ToString());
}
private void ReadPulses()
{
cameraRoi.wmPulses = camera.Idc100.Pulses;
cameraRoi.wmRefPulses = StateMachine.ControlBoard.EtPulses(0);
}
/// <summary>Start this operation</summary>
public void Start()
{
ReadPulses();
}
/// <summary>Run this operation</summary>
/// <returns>eventDone</returns>
public Event Run()
{
ReadPulses();
return Event.ReadRegisterDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
@@ -1,295 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Cameras.CameraRoi
{
public class RoiProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public int IRoiX;
public int IRoiY;
public int IRoiW;
public int IRoiH;
public float GradPerLtr;
public bool CCW; /// Clockwise = false, Counter clockwise = true
public float ORoiW;
public float ORoiH;
public float CX;
public float CY;
public float R1;
public float R2;
public float R3;
public float Ang1;
public float Ang2;
public float AngStep;
public int MinMvmt;
public int MaxMvmt;
public int SequenceLen;
public int SequenceTiming;
public int BackgroundCorr;
public float BrightnessRoi;
public override void InitializeAll()
{
IRoiX = 60;
IRoiY = 1;
IRoiW = 520;
IRoiH = 478;
GradPerLtr = 40;
CCW = true;
ORoiW = 64.0f;
ORoiH = 64.0f;
CX = 31.0f;
CY = 31.0f;
R1 = 21.0f;
R2 = 31.0f;
R3 = 0;
Ang1 = 0;
Ang2 = 400.0f;
AngStep = 40.0f;
MinMvmt = 0;
MaxMvmt = 0;
SequenceLen = 8;
SequenceTiming = 1;
BackgroundCorr = 0;
BrightnessRoi = 1.0f;
}
string[] paramNames = new string[]
{
"IRoiX",
"IRoiY",
"IRoiW",
"IRoiH",
"Grad per liter",
"CW/CCW",
"ORoiW",
"ORoiH",
"CX",
"CY",
"R1",
"R2",
"R3",
"Ang1",
"Ang2",
"AngStep",
"Min.Mvmt.",
"Max.Mvmt.",
"Det.Seq.Len",
"Det.Seq.Timing",
"Background",
"Brightness",
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override string ToString(int i)
{
switch (i)
{
case 0: return IRoiX.ToString();
case 1: return IRoiY.ToString();
case 2: return IRoiW.ToString();
case 3: return IRoiH.ToString();
case 4: return GradPerLtr.ToString();
case 5: return (CCW ? "ccw" : "cw");
case 6: return ORoiW.ToString();
case 7: return ORoiH.ToString();
case 8: return CX.ToString();
case 9: return CY.ToString();
case 10: return R1.ToString();
case 11: return R2.ToString();
case 12: return R3.ToString();
case 13: return Ang1.ToString();
case 14: return Ang2.ToString();
case 15: return AngStep.ToString();
case 16: return MinMvmt.ToString();
case 17: return MaxMvmt.ToString();
case 18: return SequenceLen.ToString();
case 19: return SequenceTiming.ToString();
case 20: return BackgroundCorr.ToString();
case 21: return ((int)(100.0f * BrightnessRoi)).ToString();
default: return string.Empty;
}
}
public void UpdateParam(int i, string strValue)
{
switch (i)
{
case 0: IRoiX = int.Parse(strValue); return;
case 1: IRoiY = int.Parse(strValue); return;
case 2: IRoiW = int.Parse(strValue); return;
case 3: IRoiH = int.Parse(strValue); return;
case 4: GradPerLtr = Utils.ParseUFloat(strValue); return;
case 5: CCW = strValue.ToLower().Equals("ccw"); return;
case 6: ORoiW = Utils.ParseUFloat(strValue); return;
case 7: ORoiH = Utils.ParseUFloat(strValue); return;
case 8: CX = Utils.ParseUFloat(strValue); return;
case 9: CY = Utils.ParseUFloat(strValue); return;
case 10: R1 = Utils.ParseUFloat(strValue); return;
case 11: R2 = Utils.ParseUFloat(strValue); return;
case 12: R3 = Utils.ParseSFloat(strValue); return;
case 13: Ang1 = Utils.ParseSFloat(strValue); return;
case 14: Ang2 = Utils.ParseSFloat(strValue); return;
case 15: AngStep = Utils.ParseUFloat(strValue); return;
case 16: MinMvmt = int.Parse(strValue); return;
case 17: MaxMvmt = int.Parse(strValue); return;
case 18: SequenceLen = int.Parse(strValue); return;
case 19: SequenceTiming = int.Parse(strValue); return;
case 20: BackgroundCorr = int.Parse(strValue); return;
case 21: BrightnessRoi = ((float)int.Parse(strValue) / 100.0f); return;
default: return;
}
}
/// <summary>
/// Parses the text in the control to verify whether it represents a valid parameter.
/// </summary>
/// <param name="i">Parameter nr.</param>
/// <param name="strValue">String to be verified</param>
/// <param name="message">Message to be shown when verification fails</param>
/// <returns>'true' if parameter string is valid, 'false' otherwise</returns>
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int iDummy;
float dummy;
switch (i)
{
case 0:
case 1:
case 2:
case 3:
case 16:
case 17:
case 18:
case 19:
case 20:
if (int.TryParse(strValue, out iDummy)) return true;
break;
case 4:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 15:
case 21:
if (Utils.TryParseUFloat(strValue, out dummy)) return true;
break;
case 12:
case 13:
case 14:
if (Utils.TryParseSFloat(strValue, out dummy)) return true;
break;
case 5:
if (strValue.ToLower().Equals("cw") || strValue.ToLower().Equals("ccw")) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(RoiProcedureParams prms)
{
prms.IRoiX = this.IRoiX;
prms.IRoiY = this.IRoiY;
prms.IRoiW = this.IRoiW;
prms.IRoiH = this.IRoiH;
prms.GradPerLtr = this.GradPerLtr;
prms.CCW = this.CCW;
prms.ORoiW = this.ORoiW;
prms.ORoiH = this.ORoiH;
prms.CX = this.CX;
prms.CY = this.CY;
prms.R1 = this.R1;
prms.R2 = this.R2;
prms.R3 = this.R3;
prms.Ang1 = this.Ang1;
prms.Ang2 = this.Ang2;
prms.AngStep = this.AngStep;
prms.MinMvmt = this.MinMvmt;
prms.MaxMvmt = this.MaxMvmt;
prms.SequenceLen = this.SequenceLen;
prms.SequenceTiming = this.SequenceTiming;
prms.BackgroundCorr = this.BackgroundCorr;
prms.BrightnessRoi = this.BrightnessRoi;
}
public IParamsProvider Clone()
{
RoiProcedureParams pars = new RoiProcedureParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateProcedureParams(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
RoiProcedureParams tmp = (RoiProcedureParams)(new XmlSerializer(typeof(RoiProcedureParams)))
.Deserialize(new StringReader(dbEntity.Parameters));
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
tmp.CopyContentTo(this);
}
catch
{
}
}
public RoiProcedureParams()
{
}
public RoiProcedureParams(ComponentProcedure procedureParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procedureParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
}
@@ -1,18 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class Connect : IWorkerCmd
{
public string CmdName { get { return "Connect"; } }
public int TimeoutMs;
public Connect(int timeoutMs)
{
this.TimeoutMs = timeoutMs;
}
}
}
@@ -1,63 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class Detect : IWorkerCmd
{
public string CmdName { get { return "Detect"; } }
public int RoiNr;
public int WMeterType;
public int IRoiX;
public int IRoiY;
public int IRoiW;
public int IRoiH;
public float CX;
public float CY;
public float ORoiW;
public float ORoiH;
public float R1;
public float R2;
public float R3;
public float Ang1;
public float Ang2;
public float AngStep;
public bool CCW; /// Clockwise = false, Counter clockwise = true
public float NomSpeed;
public int SequenceLen;
public int SequenceTiming;
public int BackgroundCorr;
public float Brightness; /// Overal brightness 0.0 .. 1.0 obtained as a product of the camera and the ROI brightness
public Detect(int roiNr, int wMeterType, int iRoiX, int iRoiY, int iRoiW, int iRoiH,
float cx, float cy, float oRoiW, float oRoiH,
float r1, float r2, float r3, float ang1, float ang2, float angStep, bool ccw,
float nomSpeed, int sequenceLen, int sequenceTiming, int backgroundCorr, float brightness)
{
this.RoiNr = roiNr;
this.WMeterType = wMeterType;
this.IRoiX = iRoiX;
this.IRoiY = iRoiY;
this.IRoiW = iRoiW;
this.IRoiH = iRoiH;
this.CX = cx;
this.CY = cy;
this.ORoiW = oRoiW;
this.ORoiH = oRoiH;
this.R1 = r1;
this.R2 = r2;
this.R3 = r3;
this.Ang1 = ang1;
this.Ang2 = ang2;
this.AngStep = angStep;
this.CCW = ccw;
this.NomSpeed = nomSpeed;
this.SequenceLen = sequenceLen;
this.SequenceTiming = sequenceTiming;
this.BackgroundCorr = backgroundCorr;
this.Brightness = brightness;
}
}
}
@@ -1,16 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class Disconnect : IWorkerCmd
{
public string CmdName { get { return "Disconnect"; } }
public Disconnect()
{
}
}
}
@@ -1,34 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class Grab : IWorkerCmd
{
public string CmdName { get { return "Grab"; } }
public int X;
public int Y;
public int W;
public int H;
public int Scale;
public string FileName;
public FileFormat Format;
public float Brightness; /// Camera brightness 0.0 .. 1.0
bool WaitCompleted;
public Grab(string fileName, FileFormat format, float brihtness, bool waitCompleted)
{
X = 0;
Y = 0;
W = 640;
H = 480;
Scale = 1;
this.FileName = fileName;
this.Format = format;
this.Brightness = brihtness;
this.WaitCompleted = waitCompleted;
}
}
}
@@ -1,47 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class Measure : IWorkerCmd
{
public string CmdName { get { return "Measure"; } }
public int RoiNr; /// 1 or 2
public bool Triggered;
public int WMeterType;
public int IRoiX;
public int IRoiY;
public int IRoiW;
public int IRoiH;
public float CX;
public float CY;
public float ORoiW;
public float ORoiH;
public int MinMvmt;
public int MaxMvmt;
public float Brightness; /// Overal brightness 0.0 .. 1.0 obtained as a product of the camera and the ROI brightness
public Measure(int roiNr, bool triggered, int wMeterType,
int iRoiX, int iRoiY, int iRoiW, int iRoiH,
float cx, float cy, float oRoiW, float oRoiH,
int minMvmt, int maxMvmt, float brightness)
{
this.RoiNr = roiNr;
this.Triggered = triggered;
this.WMeterType = wMeterType;
this.IRoiX = iRoiX;
this.IRoiY = iRoiY;
this.IRoiW = iRoiW;
this.IRoiH = iRoiH;
this.CX = cx;
this.CY = cy;
this.ORoiW = oRoiW;
this.ORoiH = oRoiH;
this.MinMvmt = minMvmt;
this.MaxMvmt = maxMvmt;
this.Brightness = brightness;
}
}
}
@@ -1,18 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class Other : IWorkerCmd
{
public string CmdName { get { return "Other"; } }
public string Command;
public Other(string command)
{
this.Command = command;
}
}
}
@@ -1,24 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
class Save : IWorkerCmd
{
public string CmdName { get { return "Save"; } }
public string VariableName;
public string FileName;
public FileFormat Format;
public bool WaitCompleted;
public Save(string variableName, string fileName, FileFormat format, bool waitCompleted)
{
this.VariableName = variableName;
this.FileName = fileName;
this.Format = format;
this.WaitCompleted = waitCompleted;
}
}
}
@@ -1,18 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class SetBrightness : IWorkerCmd
{
public string CmdName { get { return "SetBrightness"; } }
public float Brightness; /// 0.0f .. 1.0f
public SetBrightness(float brightness)
{
this.Brightness = brightness;
}
}
}
@@ -1,16 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace TBF.BenchControl.Cameras.IdcCamera.Command
{
public class StartNew : IWorkerCmd
{
public string CmdName { get { return "StartNew"; } }
public StartNew()
{
}
}
}

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