Compare commits

..
Author SHA1 Message Date
Milan Hanajik bdd9b3a100 Reconfigured for GENESIS 2018-02-19 10:13:32 +01:00
Milan Hanajik 1a82625f39 Output.DB.SaveFlowmeterCorrections completed, ver. 2.18.818 2018-02-19 09:42:20 +01:00
Milan Hanajik bcc54ccd8f ver. 2.18.817 2018-02-16 16:18:41 +01:00
Milan Hanajik 5df13df7fc Big fixes : Ambient ST/EN result items. 2018-02-16 15:32:00 +01:00
Milan Hanajik 47fd6206f6 Minor changes 2018-02-16 14:16:59 +01:00
Milan Hanajik 776f8ed841 SaveFlowmeterCorr : Support for calibration of multiple flow meters and ranges, part 1, UI, ver. 2.18.816 2018-02-16 12:59:24 +01:00
Milan Hanajik cf20ca885e ver. 2.18.815 2018-02-16 09:44:42 +01:00
Milan Hanajik e2e7a091af Changes in program shutdown reverted, ver. 2.18.814 2018-02-16 06:54:14 +01:00
Milan Hanajik 17e605cfd9 UI2BenCmd.Shutdown is re-sent each 3 sec in MainWnd on exit, CheckUIOp and MainSeq modifications, ver. 2.18.813 2018-02-15 16:05:45 +01:00
Milan Hanajik 80999a8573 ErrorFlags E1 and E21 modified, E1 now checks the mean flow, ver. 2.18.812 2018-02-15 14:17:22 +01:00
Milan Hanajik 8deb18fe9c Procedure numbers displayed in procedureComboBox in MainWnd. 2018-02-15 13:52:00 +01:00
Milan Hanajik bb3688bf7a Cleanup, Polish language, ver. 2.18.812 2018-02-15 13:51:40 +01:00
Milan Hanajik d3c7d54466 GraphsTabPageCtrl bug fix : Crash when 'current' node is used, ver. 2.18.811 2018-02-14 19:44:39 +01:00
Milan Hanajik b844aafcf3 Statistics, ProcesData, Plotter, IPlotter, GraphsTabPageCtrl, FlyingStartMassCollection changes 2018-02-14 19:27:11 +01:00
Milan Hanajik 5f17dabb0b (1) IPlotter interface used in Statistics, (2) Plotter class, (3) Start/Stop statistics in all test methods, (4) Flow simulation in FlyingStartMassCollection (DebugMode.Inherit). 2018-02-12 17:50:39 +01:00
Milan Hanajik e0fb7927ed Bug fix in Output.DB.SaveFowmeterCorrections, ver. 2.18.803 2018-02-11 08:18:58 +01:00
Milan Hanajik 567ea533a9 Output.DB.SaveFlowmeterCorrections component completed. 2018-02-11 08:09:32 +01:00
Milan Hanajik cb62b0eb3a (1) Startup after OK, (2) Shutdown rewritten, optionally with tank draining, ver. 2.18.802 2018-02-08 05:06:00 +01:00
Milan Hanajik 069d3865d4 Output.DB.SaveFlowmeterCorrections component added, ver. 2.18.801 2018-02-06 14:33:21 +01:00
Milan Hanajik a40ba5243e ProductionMonitoring ReferenceRecord.Result: 0...OK, >=1 ... Error code, ver. 2.18.800 2018-02-06 11:04:09 +01:00
Milan Hanajik 2c7d1af146 DataEntry.Standard6 supports remarks (batch and watermeters), ver. 2.18.799 2018-02-05 17:41:29 +01:00
Milan Hanajik 6bf5bdce2b Diverter change (PETERSBURG_200). 2018-02-01 23:04:15 +01:00
Milan Hanajik c5c4a571c5 Users management changes, list of users read only once, ver. 2.18.798 2018-02-01 22:18:48 +01:00
Milan Hanajik 9464e3e4e1 Changes for BADGER stredna trat, ver. 2.18.797 2018-01-31 18:05:17 +01:00
Milan Hanajik 03b99f1bbf SampleConfig updated (English, etc.), ver. 2.18.796 2018-01-31 15:46:32 +01:00
Milan Hanajik d2e9b6f582 ver. 2.18.795 2018-01-31 11:49:31 +01:00
Milan Hanajik 2bc8a5629f MettlerToledo.Multi drain valve fixes (BalanceDev, BalanceCfg, etc. changes), ver. 2.18.794 2018-01-31 11:16:29 +01:00
Milan Hanajik 95ad2484ef BADGER-stredna-trat component added, BADGER_STREDNA_TRAT define/if/elif added, ver. 2.18.793 2018-01-30 15:19:23 +01:00
Milan Hanajik 9a8f8722bd TBF.BenchControl.Output.DB.ProductionMonitoring completed, ver. 2.18.792 2018-01-30 12:41:30 +01:00
Milan Hanajik 08cf231dfc ver. 2.18.792 2018-01-30 08:37:31 +01:00
Milan Hanajik 1f13ac3c77 More Output.DB.ProductionMonitoring changes, ver. 2.18.791 2018-01-29 16:18:39 +01:00
Milan Hanajik d9bea4209c ver. 2.18.791 2018-01-29 12:03:32 +01:00
Milan Hanajik 159390c094 ver. 2.18.790 2018-01-29 10:12:21 +01:00
Milan Hanajik 0d3ee53bd5 Refactoring : TestBenchFramework --> TBF ver. 2.18.789 2018-01-29 09:48:01 +01:00
Milan Hanajik 06018303e7 TBF.BenchControl.Output.DB.ProductionMonitoring added. 2018-01-26 13:56:09 +01:00
Milan Hanajik 51e91cdab0 MonitoringDB project (class library) added. 2018-01-26 13:56:06 +01:00
Milan Hanajik 7038c1163f TBF : Required group membership is 'Testers' (merging with Sledovanie_vyroby). 2018-01-25 13:32:13 +01:00
Milan Hanajik 812b5cddcc More users management changes : Localization of user groups. 2018-01-25 13:30:48 +01:00
Milan Hanajik caed4635eb Timing related bug in BenchesDlg when editing database setting on startup fixed. 2018-01-25 10:41:20 +01:00
Milan Hanajik 7043e4e11e Bugs in user management fixed (no DB change), ver. 2.18.788 2018-01-25 10:30:42 +01:00
Milan Hanajik 566dfb7ba8 DB change : 'RangeIx' added to Entities.MeasurementCorrection, Elde.FlowMeter supports multiple correction curves, etc, ver. 2.18.787 2018-01-24 14:28:34 +01:00
Milan Hanajik b0238fc0a3 FlyingStartFirstRepetWithMassColl uses NextTestVolume test parameter. 2018-01-24 14:12:55 +01:00
Milan Hanajik 47ae6ab4ae Genesis : Component upgraded, supports Div time measurement, ADC bug fixes. 2018-01-24 14:07:49 +01:00
Milan Hanajik 14716e4ed1 OuterLoop improvements : Test shown on the screen in correct order, loop start/stop 'test repeats count' can be 1 now, TODO: Make test selection inside the loop possible. 2018-01-24 13:59:20 +01:00
Milan Hanajik 095d4aab2b Cosmetical changes and minor improvements 2018-01-24 13:55:16 +01:00
Milan Hanajik 4144a8970b Genesis : Bug fixes in assignments of ADC-s to regul. valves and flowmeters to diverters. 2018-01-24 13:42:07 +01:00
Milan Hanajik ec3c0aae0a Bug fix in GetResultsTestsAreColumns( ) (2x), ver. 2.17.782 2018-01-24 13:38:54 +01:00
Milan Hanajik b443cab973 Previous results are shown in a modeless dialog, ver. 2.17.777 2018-01-16 17:23:53 +01:00
Milan Hanajik 2e3b120bb1 FlyingStartMassCollProlonged test method, tested OK on Genesis test bench. 2018-01-16 17:23:38 +01:00
Milan Hanajik d640a2f4b6 FlyingStartFirstRepetWithMassColl test method, 'ConstMaster' and 'ErrorMaster' from the 1st rep. used in remaining reps., ver. 2.17.775 2018-01-16 17:22:21 +01:00
Milan Hanajik 5116767ec7 Results.DB change : SessionFactory erased only when the new connection string differs from the previous one. 2018-01-03 13:00:08 +01:00
Milan Hanajik 43412cde9e ver. 2.17.772 2017-12-20 13:28:35 +01:00
Milan Hanajik d225d97863 Component import/export implemented, ver. 2.17.771 2017-12-20 09:14:43 +01:00
Milan Hanajik 7983423e2a RumMob : Component upgraded, 19.12.2017, zmena poradia teplomerov 2017-12-19 16:51:12 +01:00
Milan Hanajik 7859ce582a FlowMeterTriplet (for RumMob) added, ver. 2.17.770 2017-12-18 13:47:02 +01:00
Milan Hanajik 3e1013fc12 Bug fix in StartMeasurementOp, ver. 2.17.769 2017-12-18 12:38:02 +01:00
Milan Hanajik 5f7b4443c2 IFlowMeter.ReadFlow() and IFlowMeter.ReadFrequency() added, ReadFlowOp and SetFlowOp modified, ver. 2.17.768 2017-12-15 13:21:42 +01:00
Milan Hanajik 57977ae8b6 ver. 2.17.767 2017-12-12 11:33:42 +01:00
Milan Hanajik d21d4fb766 iPerl : Q2 correction calculation takes into account ihead.CalibTarget, ver. 2.17.766 2017-12-11 16:47:03 +01:00
Milan Hanajik 298d4a9b17 ver. 2.17.765 2017-12-11 10:15:11 +01:00
Milan Hanajik be82f1fe0e (1) MainSeq : Q1, Q2, Q3 buttons fixed, (2) outer loop error fix, (3) Components can be managed by Administrators only. 2017-12-08 15:12:32 +03:00
Milan Hanajik 459cb5bb4a (1) Progress bars fixes, (2) Fixes in sequences: cBrd.StopPreviousOp() called at the end (also) when isLastRepetition == true. 2017-12-08 15:07:09 +03:00
Milan Hanajik 8d39bf82d2 Camera binary files: rc.local and runmeonce removed, camera loging level change, ver. 2.17.764 2017-12-08 12:33:37 +03:00
Milan Hanajik e762aca7fb Bahrain: Component upgraded (4.12.2017), changes for diverter, faster program shutdown, camera bins changed, ver. 2.17.763 2017-12-08 11:04:46 +03:00
Milan Hanajik ace0bdb2a6 Supports camera upgrade to SD 1.3, ver. 2.17.762 2017-12-08 09:06:27 +03:00
Milan Hanajik f6e44914fa Output.Printers.OnePerMeter can print water meter images. 2017-12-06 14:57:56 +03:00
Milan Hanajik 6b6098164a FixedStartDeferredEvaluationSeq : Simulation mode fixed, copies sample images correctly. 2017-12-06 14:53:35 +03:00
Milan Hanajik 6572623313 Oputput.FileWriters.ImageArchiver fixes and improvements (folder name may use BatchNr). 2017-12-06 14:52:10 +03:00
Milan Hanajik 7f4bbcccf2 DataEntry.Standard6 / 12 / 24 / Camera : CycleEndForm-s consolidated (they were outdated). 2017-12-06 14:50:18 +03:00
Milan Hanajik a49a81cff7 (1) Results.Utils.PassedColorStr() with PASSED/FAILED, (2) WMeterRsltsItemSpec: Formatted_WM_ID, (3) Legalizator for Bahrain, ver. 2.17.761 2017-12-06 09:58:57 +03:00
Milan Hanajik 88fc2d4951 DiscoveryDaemon ver. 1.5. added. 2017-12-06 00:02:07 +03:00
Milan Hanajik 2c64b8905d IDevice and all devices modified, void StopDevice2( ) introduced, makes program exit faster. 2017-12-05 21:26:07 +03:00
Milan Hanajik dda796b929 ProcessTabPageCtrl6,24,48: Prevent conversion Double -> Float -> Double. 2017-12-05 20:49:38 +03:00
Milan Hanajik 4fd332490a Program exit troubleshooted and corrected, TODO: Shutdown of camera threads (2 stage StopDevice ?). 2017-12-04 19:51:59 +03:00
Milan Hanajik be7c433343 All printers enhanced and cleaned up: Template, Footer font, Doc.Name, etc., ver. 2.17.760 2017-12-04 18:53:56 +03:00
Milan Hanajik 6181e6a0f2 List of procedures in 'Procedure' combo box in MainWnd is updated after closing ProceduresDlg using 'x' button. 2017-12-04 18:35:45 +03:00
Milan Hanajik c5453fff5b MainSeq, ITestMethod and all test methods changed, transitions are done in MainSeq (DoTransitions()), no outerLoopCounter, ver. 2.17.757 2017-12-03 18:44:57 +03:00
Milan Hanajik b9b7fc95b4 DataEntry.StandardCamera.TestStartEndForm : Zoom and rotation are saved in arrays separately for each meter, ver. 2.17.755 2017-12-02 18:44:32 +03:00
Milan Hanajik b8a51409ab RUM_MOB component upgraded (10.11.2017), RUM_MOB define processing fixes (I41 etc.), ver. 2.17.754 2017-12-01 15:21:54 +01:00
Milan Hanajik cebaab8e8b iPerl : ConfigStruct erased at the beginning of 'ReadConfiguration', iPerlHead.ClearData() called in MainSeq when procedure selected, ver. 2.17.753 2017-12-01 12:06:24 +01:00
Milan Hanajik 76bef24456 Output.FileWriters.Basic : PrintCaption parameter added, no empty line when there are no common items, ver. 2.17.752 2017-12-01 10:53:11 +01:00
Milan Hanajik 871b95891d DataEntry.StandardCamera.TestStartEndForm : Combination of zoom and rotation fixed. 2017-11-30 21:35:14 +01:00
Milan Hanajik f5ddde647a ErrorFlags : Cosmetical bug fix. 2017-11-26 22:31:51 +01:00
Milan Hanajik d4de7db70d ver. 2.17.751 2017-11-24 16:37:24 +01:00
Milan Hanajik ad858266d5 StandardCamera.TestStartEndForm : Image rotation, ver. 2.17.749 2017-11-23 15:10:01 +01:00
Milan Hanajik 8772004e8e More camera logging, ROI: imgFileNamePrefix, ver. 2.17.748 2017-11-23 13:41:33 +01:00
Milan Hanajik aec3519ec9 All data entry forms have DarkGoldenrod background color. 2017-11-23 09:19:27 +01:00
Milan Hanajik 20bbbc7741 Results.Entities.WaterMeterData.NewQnames mapped to the database (MUNICH only), ver. 2.17 2017-11-23 09:18:04 +01:00
Milan Hanajik 5ee93200ed MainSeq : Deferred test evaluation when single test is executed. 2017-11-23 09:15:25 +01:00
Milan Hanajik 981c399e65 DataEntry.StandardCamera changes: ShowTestEndFormOp uses regReaders, ShowDeferredTestEvalFormOp, etc. 2017-11-22 23:53:41 +01:00
Milan Hanajik 96429a8c7a Simlation mode for Camera.CLP1611, ver. 2.17.746 2017-11-22 21:06:43 +01:00
Milan Hanajik e1fc3e7b82 FixedStartMassCollectionSeq minor bug fixes. 2017-11-22 21:06:00 +01:00
Milan Hanajik 498115637a Framework for deferred test evaluation (e.g. FixedStartDeferredEvaluation method) in MainSeq complete, ITestMethodWith2ndPass added. 2017-11-22 21:05:10 +01:00
Milan Hanajik 2322a145f6 DataEntry.StandardCamera.CycleEndFormMunich and added ProtocolTitle# parameters added. 2017-11-22 13:58:03 +01:00
Milan Hanajik 53bab003bf FixesStartDeferredEvaluation test methods added, based on FixedStartMassCollection, TODO: Change functionality, ver. 2.17.745 2017-11-22 12:12:04 +01:00
Milan Hanajik 97fc922321 Changes : (1) StandardCamera.TestStartEndForm size, (2) FixedStartMassCollectionSeq delay before 1st mass m., (3) German, (4) Reload prev. btn. hidden, ver. 2.17.744 2017-11-22 10:54:51 +01:00
Milan Hanajik 8c32d64f35 DataEntry.Munich3, DataEntry.StandardCamera use FixedStartRegisterReader and RoiForFixedStart procedure parameter PulsesPerLtr. 2017-11-22 01:22:59 +01:00
Milan Hanajik 1dfbf12f46 sensPath.RegisterReaders passed to all TestStartEndform-s, ver. 2.17.743 2017-11-21 22:29:31 +01:00
Milan Hanajik 0f9256325c Krakow component added, KRAKOW_50 symbol added, ver. 2.17.742 2017-11-21 15:12:23 +01:00
Milan Hanajik 93c6ba5e74 More MunichPrintDocument changes, s/n repeated on the 2nd page, ver. 2.17.741 2017-11-21 11:32:42 +01:00
Milan Hanajik 2d3e14fc6c WMeterRsltItemSpec bug fix, ver. 2.17.740 2017-11-21 10:41:36 +01:00
Milan Hanajik 3ad842b02a (1) 'bool NewQnames' added to IWaterMeter, WaterMeters.Munich and elsewhere, (2) German language : Control water temp., Temp lim lo, Temp lim hi. 2017-11-21 10:04:02 +01:00
Milan Hanajik 14cfb65b6b Main window menu items customization. 2017-11-21 09:29:53 +01:00
Milan Hanajik cd926f559d Output.Printers.Munich document has two pages for a large number of tests, ver. 2.17.739 2017-11-21 09:28:53 +01:00
Milan Hanajik cafa247279 RegulValveCoax.SetFlowOp : More logging. 2017-11-20 18:16:59 +01:00
Milan Hanajik e411b80fdc Bugs in RegulValveCoax fixed, ver. 2.17.738 2017-11-20 14:31:47 +01:00
Milan Hanajik ae5e680e35 Many WMeterRsltItemSpec-s added. 2017-11-16 16:29:13 +01:00
Milan Hanajik db684afd84 [dm3] 2017-11-16 16:29:08 +01:00
Milan Hanajik dc2ab14412 Wodomierz -> Obiekt 2017-11-16 16:29:02 +01:00
Milan Hanajik 9e28ca5df3 Printers.Zapiska, OnePerMeter, etc. changes: flow coordinates, content separated from layout, etc. 2017-11-16 16:27:28 +01:00
Milan Hanajik dcfc12a849 Bug fix in v.2.17.730, new ver. 2.17.734 2017-11-15 10:16:12 +01:00
Milan Hanajik ad3f9b53ad ver. 2.17.733 2017-11-14 17:59:05 +01:00
Milan Hanajik e7e0937ae5 Multiple access to files in TBF/CameraBinaryFiles prevented, ver. 2.17.732 2017-11-14 17:34:15 +01:00
Milan Hanajik 0325b0214b Temperature corrected by calibration curve (corrections). 2017-11-14 16:35:46 +01:00
Milan Hanajik 6d616ca4cc Modifications in Output.Printers.Zapiska, multiple-line headers are possible, ver. 2.17.731 2017-11-14 15:55:06 +01:00
Milan Hanajik a2620870ad Changes for Audit, ver. 2.17.730 2017-11-13 16:17:36 +01:00
Milan Hanajik a9ab29fcbb ver. 2.17.729 2017-11-12 15:53:28 +01:00
Milan Hanajik 65f2c4d4a5 Camera.CLP1611: Synchronization of files in camera '/home/tbf/clp' directory and 'TBF/CameraBinaryFiles' project folder. 2017-11-12 15:29:55 +01:00
Milan Hanajik 2ba5c8277d iPerlCommunication bug fix for non-ORACLE_DB test benches, ver. 2.17.728 2017-11-12 15:27:21 +01:00
Milan Hanajik 28f3b3f323 Modifications in Saving previous results, current Oracle DB component settings are loaded, extra info message shown. 2017-11-10 14:03:05 +01:00
Milan Hanajik 607dbaacb1 Oracle DB changes from iPerl-12 branch, WMType_ID/Rev dropped from WaterMeter, CheckBarcodeScanning operation commented out. 2017-11-10 12:50:39 +01:00
Milan Hanajik 656bd36a1d Camera binary files management : Work in progress. 2017-11-09 10:25:09 +01:00
Milan Hanajik 1b83bd22b9 DataEntry.iPerl and DataEntry.Standard48 fixed - start/stop test method, ver. 2.17.727 2017-11-09 10:24:45 +01:00
Milan Hanajik 54eba8509e Modbus and QuidoRS modifications: Messages are send immediately (are not enqueued) if permitted by timing. 2017-11-09 10:17:10 +01:00
Milan Hanajik 996b88cb2e 'iPerl Heads' edit feature and tool strip menu item added, delays after Quido.SetOutputs() increased to 2000ms. 2017-11-09 10:13:34 +01:00
Milan Hanajik 441d950e94 Comments, style changes, etc. 2017-11-09 10:13:21 +01:00
Milan Hanajik 59c2afe0e8 UpgradeSelectionDlg support for 2.12-->2.17, ver. 2.17.722 2017-11-07 11:07:11 +01:00
Milan Hanajik 441cf91ff6 Reference pulses displayed correctly using test when using camera ROI. 2017-10-27 16:29:00 +02:00
Milan Hanajik 41a1b3323f Valve timing changes applied immediately, no program restart required. 2017-10-27 16:06:29 +02:00
Milan Hanajik 4e31493cc8 Camera : TestImagesCount up to 3000, load/save images parameters are volatile (not saved to DB), ver. 2.17.721 2017-10-27 15:05:01 +02:00
Milan Hanajik 8abe8df823 Measurement results via UDP, telenet not used for measurement anymore, Roi supports Simulate mode, ver. 2.17.720 2017-10-27 12:14:05 +02:00
Milan Hanajik 39af5d29c6 Camera.CLP1611 : TestImagesMode itroduced, passed to Measurement command, ver. 2.17.719 2017-10-26 15:20:26 +02:00
Milan Hanajik 52d073cb8c TftpServer removed from project. 2017-10-26 14:23:46 +02:00
Milan Hanajik 65a6854cc0 ver. 2.17.718 2017-10-26 10:36:53 +02:00
Milan Hanajik ec540bcf20 (1) Camera measurement stopped by 'Q', (2) Telnet login timeout increased, (3) going to remove Telnet, (4) default cfg for Camera, Roi, RoiForFixedStart. 2017-10-26 10:28:49 +02:00
Milan Hanajik 4e9748f4dc (1) Opraw DEWY disabled, (2) Upgrade DB 2.16->2.17 button, (3) minor fixes in IPERL related things, ver. 2.17.717 2017-10-24 16:39:30 +02:00
Milan Hanajik 82da9bc2e7 Bug fix in DataEntry.StandardCamera.TestStartEndForm, ver. 2.17.714 2017-10-23 10:53:50 +02:00
Milan Hanajik 4cc9715f57 CameraUICmd and CameraUICmdEventArgs added ti UiBridge 2017-10-20 16:05:51 +02:00
Milan Hanajik 75f72cb04e ResultsBrowser ver. 2.17.712 2017-10-20 15:39:01 +02:00
Milan Hanajik 3d58b8baf2 Camera.CLP1611 component parameters change handler. 2017-10-20 14:05:38 +02:00
Milan Hanajik 0c2839e6c9 Temperature (TempUpMean + TempDownMean) / 2 used for density and volume calculations, ver. 2.17.712 2017-10-19 19:04:13 +02:00
Milan Hanajik 0df833ca8a REM Kepno specific changes (result string, etc.), ver. 2.17.711 2017-10-19 18:05:05 +02:00
Milan Hanajik 82988ce74f (1) DataEntry.StandardCamera.TestStartEndForm image size 640x480, (2) ZOOM implemented, (3) simulation mode, ver. 2.17.710. 2017-10-19 14:27:16 +02:00
Milan Hanajik 32fbb2964e Advanced flow setting algorithm with adaptive behavior, ver. 2.17.709 2017-10-19 10:34:10 +02:00
Milan Hanajik 38d7562bb3 Repettition nr. > 1 can be selected in the main sequence. 2017-10-19 09:19:31 +02:00
Milan Hanajik a8dd8d98cb (1) E15 modified, no E16, (2) Qref_min, Qref_max, Qref_start, Qref_end added to results, ver. 2.17.708 2017-10-19 09:18:50 +02:00
Milan Hanajik 615383f924 Cleanup. 2017-10-18 18:03:54 +02:00
Milan Hanajik 25fa494b7b (1) Output.FileWriters.Basic: header, common, footer, etc., (2) TableRowNr, TableColumnNr in all outputs, ver. 2.17.707 2017-10-18 18:03:40 +02:00
Milan Hanajik 8b321e36db Diverter times saved in SummaryResults and AllResults, timing of 'end' measurement slightly changed, ver. 2.17.706 2017-10-18 12:08:15 +02:00
Milan Hanajik 3822c6f5ab Calculated error limits for heat meter flow measurement testing, ver. 2.17.705 2017-10-18 10:52:15 +02:00
Milan Hanajik 21a329b1d3 Kepno 50 component upgraded (diverter 500ms), dated 18.10.2017 2017-10-18 10:51:50 +02:00
Milan Hanajik 8d669d9f54 Flow selection test wizard uses a Tab-control, bug in ProcedureDlg (causing a non-zero initial Qfrom/Qto) fixed. 2017-10-17 18:25:05 +02:00
Milan Hanajik 9a905c6111 Minor improvements. 2017-10-17 18:22:01 +02:00
Milan Hanajik 239bcddfa2 ReadDiverterTransitionOp implemented, ver. 2.17.704 2017-10-17 16:06:46 +02:00
Milan Hanajik cd5e20a3f4 'Stop backflow valve' support in RoiDetection. 2017-10-17 16:04:42 +02:00
Milan Hanajik 518e87e4f1 Qfrom and Qto shifted 25% toward the center, ver. 2.17.700 2017-10-17 16:04:37 +02:00
Milan Hanajik 6cd0be4c17 TestMethods.SensitivityTest added. 2017-10-17 16:04:33 +02:00
Milan Hanajik 04db65f01f Kepno 50 component upgraded, related changes in IControlCom etc., dated 11.10.2017 and 16.10.2017. 2017-10-17 16:04:12 +02:00
Milan Hanajik aa63fe2cb4 Bug fix in Output.FileWriters.Xml 2017-10-17 11:12:09 +02:00
Milan Hanajik 0593e3484c Error Formula modified. 2017-10-17 11:12:04 +02:00
Milan Hanajik 80bb277386 Resizing of camera pictures using '+' and '-' buttons implemented. TODO: Full screen mode, ver. 2.17.699 2017-10-17 10:14:35 +02:00
Milan Hanajik ec22661e87 TimePumpwStartV and StopBFValve supported in FlyingStart, FixedStart and Adjustment methods. 2017-10-16 10:30:42 +02:00
Milan Hanajik 80cdc2fb95 Component for Bahrain upgraded (dated 11.10.2017) 2017-10-12 22:12:05 +02:00
Milan Hanajik bfedd4d11b Bug fixes : WMeterRsltItemSpec-s for iPerl. 2017-10-11 09:31:44 +02:00
Milan Hanajik f58831f916 iPerl heads (WM positions) can be disabled by a user (port from branch iPerl-12) : Part 2, functional changes, ver. 2.17.697 2017-10-11 09:30:08 +02:00
Milan Hanajik 328d6b7fa7 iPerl heads (WM positions) can be disabled by a user (port from branch iPerl-12) : Part 1, auxiliary changes. 2017-10-11 08:47:36 +02:00
Milan Hanajik 98105cbf21 ver. 2.17.696 2017-10-06 13:31:03 +02:00
Milan Hanajik c9c57db7c1 Output.Printers.OnePagePerMeter.Printer implemented, fixes in Culture configuration, ver. 2.17.695 2017-10-06 13:26:48 +02:00
Milan Hanajik 7d4f1b2a44 ver. 2.17.694 2017-10-06 10:07:44 +02:00
Milan Hanajik 7b7d1994c7 Symbol RUM_MOB processing added, component for the mobile test bench for Romania added, ver. 2.17.693 2017-10-05 12:50:51 +02:00
Milan Hanajik 8b438d8d76 ver. 2.17.692 2017-10-05 11:18:38 +02:00
Milan Hanajik 7a510a98ad Russian translations, ver. 2.17.691 2017-10-05 11:12:40 +02:00
Milan Hanajik 66034de880 ver. 2.17.690 2017-10-04 13:16:31 +02:00
Milan Hanajik b9ca3e6beb PW 2017-10-04 13:08:41 +02:00
Milan Hanajik 9ad0872854 Bug fix: Error flags related bug fixed, ver. 2.17.689 2017-10-04 13:08:28 +02:00
Milan Hanajik e6933922cd ver. 2.17.687 2017-10-04 10:41:59 +02:00
Milan Hanajik d6d6d88e20 Changes in Russion language, ver. 2.17.686 2017-10-04 10:35:00 +02:00
Milan Hanajik 8974d93877 ver. 2.17.685 2017-10-03 14:12:41 +02:00
Milan Hanajik 7e6bef9008 DB upgrade via menu Settings/Upgrade from 2.15 to 2.17 implemented, ver. 2.17.684 2017-10-03 14:11:14 +02:00
Milan Hanajik 1e2711a616 Component 'Copy' implemented. 2017-09-29 15:41:23 +02:00
Milan Hanajik fd81675168 Output.Printers.Zapiska : 'Good only' option implemented, ver. 2.17.681 2017-09-29 15:21:40 +02:00
Milan Hanajik 3dc347c66a Modbus.PressureMeter.Meret : data request sent every 3 seconds, ver. 2.17.681 2017-09-29 13:20:23 +02:00
Milan Hanajik 8a8f4fa563 Component for Kepno-50 upgraded, dated 29.09.2017, cosmetical changes. 2017-09-29 13:11:44 +02:00
Milan Hanajik ed3fc330ab Stopping TBF program optimized, ModelessActivityForm used, rtpListenerThread.Join(.) in Camera shortened to 200 ms, ver. 2.17.680 2017-09-29 08:19:59 +02:00
Milan Hanajik 9fa025caa4 Diverter and start/stop valve switch time logging in ms, ver. 2.17.679 2017-09-28 17:11:41 +02:00
Milan Hanajik b54f938bd5 Modbus.CometAmbient component implemented (Comet and Easytherms are connected to the same Modbus), ver. 2.17.678 2017-09-28 15:24:10 +02:00
Milan Hanajik 4efba80fc6 Measurement of valve open/close time required for E11, E12 evaluation. DiverterStart/DiverterEnd is float in sec., ver. 2.17.677 2017-09-28 12:54:16 +02:00
Milan Hanajik c3eab4820f Zapiska: (1) GapBetweenTableColumns (20 -> 10), (2) multiline item support. 2017-09-28 12:53:37 +02:00
Milan Hanajik a5bb127a1e (1) Zapiska bottom columns fixed, (2) unused WM-s disabled after reloading results, (3) Passed_seals_count, Diverter_start/end_time added, ver. 2.17.675 2017-09-28 09:39:58 +02:00
Milan Hanajik ae1ed99c9f ErrorFlags E15 and E16, Results DB upgraded (int ErrorFlags in WaterMeter table, int DiverterStart, DiverterEnd in TestRslt table), ver. 2.17.674 2017-09-28 00:07:47 +02:00
Milan Hanajik fa36932fbc Network.Camera.Display extended to 12 images. 2017-09-28 00:07:42 +02:00
Milan Hanajik 9ac3dd07b9 WMeterRsltItemSpec cleanup, DblFormat(...) does units conversion. 2017-09-27 21:29:10 +02:00
Milan Hanajik 4ca28941d0 Component for Kepno 50 dated 27.09.2017 upgraded, start/stop valve time measurement added. 2017-09-27 14:56:02 +02:00
Milan Hanajik 4b2e207ddf WMeterRsltItemSpec with a possibility to specify number of significant digits. 2017-09-27 14:55:48 +02:00
Milan Hanajik 88055f1c84 ErrorFlags modifications. 2017-09-27 13:10:55 +02:00
Milan Hanajik 2f68a9444a Bug fix in Output.Printers.Zapiska, ver. 2.16.673 2017-09-27 13:10:20 +02:00
Milan Hanajik 0ccd711b0f (1) CameraPictureCtrl modified, (2) LiveStreamSeq modified, (3) cleanup and more logging. 2017-09-27 13:08:36 +02:00
Milan Hanajik 63a6cb7afe Diverter time logging in FlyingStartMassCollectionSeq, camera commands logging, ver. 2.16.670 2017-09-27 09:11:53 +02:00
Milan Hanajik d9fc5482db E15 and E16 implementation in progress. 2017-09-27 09:11:06 +02:00
Milan Hanajik 4f06438371 Kepno-50 component upgraded, dated 26.09.2017, Pr2 and Pr3 labels swapped. 2017-09-26 22:53:38 +02:00
Milan Hanajik 5afb5f2419 CameraPictureCtrl-s are in FlowLayoutPanel inside PicturesTabPageCtrl. Config button and split container removed. 2017-09-26 19:56:31 +02:00
Milan Hanajik 9f467a23b4 Camera info displayed in PicturesTabPage, PicturesTabPageCtrl and CameraPictureCtrl cleanup, ver. 2.16.669 2017-09-26 18:34:20 +02:00
Milan Hanajik 76dd46b30c Kepno component upgraded: dated 22.09.2017 2017-09-26 14:46:08 +02:00
Milan Hanajik 0c1ddecaf1 Results items 'Passed_meters_count' and 'Failed_meters_count' added. 2017-09-26 14:46:04 +02:00
Milan Hanajik d36d4733ca Zapiska modified. 2017-09-26 14:45:49 +02:00
Milan Hanajik 18dac8fb72 Legalizator (= 2nd user) support, ver. 2.16.667 2017-09-26 09:45:18 +02:00
Milan Hanajik fb1db6df1c Define for SLM_150 fixed. 2017-09-25 22:26:29 +02:00
Milan Hanajik 3fb487b67b (1) E9,E10,E15,E16 implemented, (2)Zapiska: Each WM is in one table row, (3) TableRowNr,TableColumnNr,WMRemark added to RsltItems 2017-09-25 22:25:09 +02:00
Milan Hanajik 2e1d497aad (1) Output.Printers.Zapiska introduced, (2) Kempno component upgraded, dated 13..9.2017 2017-09-21 16:44:33 +02:00
Milan Hanajik 754bd14342 Graphs changes in progress 2017-09-21 16:44:15 +02:00
Milan Hanajik c4026c87ce PlotterDisplayEx with a demo graphs added to GraphsTapPageCtrl. 2017-09-20 13:41:25 +02:00
Milan Hanajik e6b8454a94 'Graphs' menu item and graphsTabPage added to MainWnd and mainTabControl. 2017-09-20 12:51:59 +02:00
Milan Hanajik 98f68d6b45 GraphLib package added, an empty GraphsTabPageCtrl added, no tab control and menu changes in MainWnd, ver. 2.16.661 2017-09-20 10:48:35 +02:00
Milan Hanajik 5ef1bcbdb6 Calibration target introduced in iPerlHead.ProcParams and iPerlhead.IperlHead. CalculateNewCalibFactor( ), ver. 2.16.660 2017-09-18 12:32:39 +02:00
Milan Hanajik 7846239be9 (1) LiveStreamSeq with MessageBoxOP, (2) "-jpg" added to ROI-detection command, (3) IRoi: DetectedImageName -> ImageFileNamePrefix, ver. 2.16.658 2017-09-15 09:30:06 +02:00
Milan Hanajik f8e2d6c86b Network.Camera.Display bug fix. It was not possible to retry ROI-Detection, ver. 2.16.657 2017-09-14 16:00:16 +02:00
Milan Hanajik b06f4a5781 CLP1611.LiveStreamOp modified to issue an appropriate command for MJPEG RTP stream, VLC removed, ver. 2.16.656 2017-09-14 12:58:26 +02:00
Milan Hanajik 968faf9200 CLP1611.Camera live image using MJpeg RTP protocol support implemented. 2017-09-14 11:54:32 +02:00
Milan Hanajik 62ceb13385 FlowStart and FlowEnd saved into TestRslt at the end of each test. 2017-09-13 15:48:31 +02:00
Milan Hanajik bed0046618 (1) More logging, (2) Bug fixes in Statistics, (3) Bug fixes in ErrorFlags.Errors, ver. 2.16.655 2017-09-13 10:54:23 +02:00
Milan Hanajik 8a2287c685 WinSCPnet package replaced by Renci.SshNet, Camera, GrabImagesOp and RoiDetectionOp modified, ver. 2.16.651 2017-09-09 10:42:45 +02:00
Milan Hanajik 3c85440d34 (1) No MessageBox when writing opto-data fails, (2) Read1, Read2, Read3, Read4 added to CommErr enum, ver. 2.16.650 2017-09-06 10:25:22 +02:00
Milan Hanajik 7ed21ff08c SwitchDiverterOp, Diverter sequence conditions, ver. 2.16.647 2017-08-22 16:20:52 +02:00
Milan Hanajik df42ec3d3a Saving ResultCode with RFID and OptoData error code for iPerls implemented, ver. 2.16.646 2017-08-22 09:28:19 +02:00
Milan Hanajik 35b62520c9 TestRslt.ErrorFlagsStr() function added, used in WMeterRsltItemSpec, ver. 2.16.645 2017-08-21 15:38:57 +02:00
Milan Hanajik e6936dc10e ver. 2.16.644 2017-08-21 13:05:20 +02:00
Milan Hanajik d5904fe9fa ErrorFlags implementation completed. TODO: E9, E10, E11, E12, E15, E16. Ver. 2.16.643 2017-08-21 12:36:37 +02:00
Milan Hanajik 20d8fbc389 ErrorFlags component added, Results.Entities.TestRslt upgraded to DB v.2.16, ErrorFlags and ErrorFlagsMd added, used in test methods, ver. 2.16.642 2017-08-20 09:54:42 +02:00
Milan Hanajik 70ccb8b4d8 Statistics support filtering, skipping first samples, etc., ver. 2.15.642 2017-08-19 13:41:49 +02:00
Milan Hanajik 175571072f Cleanup 2017-08-19 13:41:44 +02:00
Milan Hanajik b0e25a35fb Activity during initialization of devices shown in a modeless form, ver. 2.15.641 2017-08-19 13:41:31 +02:00
Milan Hanajik 08e7041bcf EnhancedPrintDocument : SW crash prevented with default configuration of fonts. 2017-08-18 10:02:17 +02:00
Milan Hanajik b58ebcd7a7 ver. 2.15.640 2017-08-17 14:23:09 +02:00
Milan Hanajik 8eb2472171 Big fix for scale s/n communication for iPerl (2 sec StateMachine ticks). 2017-08-16 15:32:05 +02:00
Milan Hanajik f73d89f41b Comments corrected/added, ver. 2.15.639 2017-08-16 13:46:21 +02:00
Milan Hanajik 95848197c5 Components for iPerl, Bahrain PT50 and Kepno PT50 upgraded (14.08.2017), ver. 2.15.638 2017-08-14 15:09:32 +02:00
Milan Hanajik 442ac6969f iPerlCommunication modifications : cfg.seMuxBoards parameter used in the worker thread, MuxBoardNr cannot be 0 anymore, should be 1..4, ver. 2.15.637 2017-08-10 15:06:29 +02:00
Milan Hanajik 3fb2c0aeff TestMethods.iPerlCommunications : UseMuxBoards component configuration parameter added 2017-08-04 17:37:39 +02:00
Milan Hanajik 8ed99092ff Bug fixes in FixedStartMassCollectionSeq, cosmetical changes in DataEntry.StandardCamera, ver. 2.15.634 2017-07-28 17:21:30 +03:00
Milan Hanajik f393709944 Camera.CLP1611.GrabImagesOp can overwrite images, ver. 2.15.633 2017-07-28 14:38:28 +03:00
Milan Hanajik 527da6bcc5 DataEntry.StandardCamera, Camera.RoiForFixedStart and FixedStartMassCollectionSeq changes, etc, ver. 2.15.632 2017-07-28 11:14:20 +03:00
Milan Hanajik 17940d453c DataEntry.Standard24 dead code clean-up (bool SensusExtensions) 2017-07-27 16:56:47 +03:00
Milan Hanajik 8d623ae8fa FirstStartMassCollectionSeq changes in progress 2017-07-27 16:38:46 +03:00
Milan Hanajik c9d3480c58 Network.Camera.RoiForFixedStart component added, IRoiForFixedStart added, supports image grabbing only. 2017-07-27 16:38:29 +03:00
Milan Hanajik e133b68472 Network.Camera.Roi bug fix, comments updated. 2017-07-27 16:38:17 +03:00
Milan Hanajik 9ecfe1e10e DataEntry.Standard24.TestStartEndForm layout changed (RU) 2017-07-27 16:38:13 +03:00
Milan Hanajik 3a38ca6b61 bool UsesCameras() added to IDataEntry and DataEntry components, DataEntry.StandardCamera added. 2017-07-27 16:37:58 +03:00
Milan Hanajik 62cb5cdba7 Elde.RegulValveCoax component added, coax support in Elde.RegulValve dropped, ver. 2.15.631 2017-07-27 10:11:16 +03:00
Milan Hanajik 1cb0345b37 Initialization of ADC open/close values and start/stop % levels for diverters redone/fixed, ver. 2.15.630 2017-07-27 09:14:57 +03:00
Milan Hanajik b3e6a3f157 Default value of water density. 2017-07-26 23:22:13 +03:00
Milan Hanajik 6ed831c968 ver. 2.15.629 2017-07-26 18:33:32 +03:00
Milan Hanajik 3f1d992879 Camera.CLP1611, ImageArchiver and TestMethods.GrabImage.GrabImageSeq changes - works OK, TODO: color jpg, ver. 2.15.628 2017-07-26 13:40:17 +03:00
Milan Hanajik c076ebce6f RoiGfg.ToString() enhanced, displays PreviousRoi 2017-07-25 16:38:21 +03:00
Milan Hanajik 56e006318f Utils.ShowROute() -> Utils.RouteToStr(), dead code Evaluate and Publish removed from all test methods 2017-07-25 16:10:06 +03:00
Milan Hanajik 4867b031b9 TestMethods.GrabImage : ImageFileName etc. added to cfg, GrabImageCfg implemented, interfaces changes, ver. 2.15.627 2017-07-25 15:43:36 +03:00
Milan Hanajik 548973cf11 Bug fixes: (1) Error msg. deleted after selection, (2) pidCoef usage during test, (3) Drain valve always closed in FlyingStartMassCollection. 2017-07-25 11:41:06 +03:00
Milan Hanajik 9c575d7fbf (1) ProcedureDlg layout, (2) DataEntry.Standard12/24.CycleBeginningForm layout, (3) ProcessTabPage6/24 layout (done for RU). 2017-07-25 11:39:05 +03:00
Milan Hanajik feefbeb5b4 (1) TankFullFactor -> 0.95, (2) bit80 calculation for PETERSBURG_200, ver. 2.15.626 2017-07-25 10:06:31 +03:00
Milan Hanajik a4d8081b73 Petersburg PT50 component upgraded, ver. 2.15.625 2017-07-24 22:25:13 +03:00
Milan Hanajik 467e51374d (1) Changes similar to Fuzhou300 done for Petersburg200, (2) Bug in RRoute for 128-bit route fixed, (3) Route display/logging 2017-07-24 22:14:57 +03:00
Milan Hanajik ec27a5843b TestMehods.GrabImage added, in construction, ver. 2.15.624 2017-07-24 22:14:27 +03:00
Milan Hanajik a6a87cccae DB ver. 2. 15 consolidated, Procedure.ProtocolTitle removed 2017-07-24 22:14:10 +03:00
Milan Hanajik 1d7a2e4a0c ValveEx change reverted, RegisterReader-s fixed : Clear() should not be used in default constructor. 2017-07-24 22:14:05 +03:00
Milan Hanajik 9ac237a377 Alternative procedure - UI implemented. 2017-07-23 21:54:03 +03:00
Milan Hanajik 74d5688936 FileWriters.ImageArchiver, FileWriters.OneFilePerMeter and Printers.OnePagePerMeter components added. 2017-07-23 21:51:22 +03:00
Milan Hanajik 534baa7aa3 Camera serial number used in UI, HardwareAddress % 100 used in DetectCamera(...) function call. 2017-07-23 11:47:31 +03:00
Milan Hanajik b11d55c2c7 Basic GrabImage support, ver. 2.14.619 2017-07-23 11:04:27 +03:00
Milan Hanajik 8fb27fc4f1 Petersburg-PT200 component updated (170718), ver. 2.14.618 2017-07-21 16:56:30 +03:00
Milan Hanajik 7332bc2a71 RRoute displayed in the status bar, ver. 2.14.617 2017-07-21 16:40:25 +03:00
Milan Hanajik ae0ebd15f7 (1) RegValveCalib array pre-initialized, (2) Test ID column supressed in ResultsArrangementDlg, (3) ValveEx fixed, ver. 2.14.616 2017-07-21 15:34:28 +03:00
Milan Hanajik b8ade55096 Changes for PETERSBURG_200, ver. 2.14.615 2017-07-21 11:08:16 +03:00
Milan Hanajik acc5b2fecd Communication with scales at the beginning (s/n, command I4) retreded 3 times. 2017-07-21 09:24:01 +03:00
Milan Hanajik e76c2afa08 Camera.Display.DisplayForm.CloseForm(sender, args) added, no conflict with other modeless forms, ver. 2.14.613 2017-07-20 20:05:44 +03:00
Milan Hanajik 8d249a96f4 Fixes in Buoyancy calculation, ver. 2.14.612 2017-07-20 19:54:33 +03:00
Milan Hanajik 229bec30cc Diverter ADC value updated in DiverterCfgCtrl (More button). 2017-07-20 14:49:16 +03:00
Milan Hanajik 5552a28925 ver. 2.14.609 2017-07-19 16:52:29 +03:00
Milan Hanajik 3bd5d0e7d3 MainSeq changes, BenchControlPanel 'disabled btn' color, Russian enum-descriptions, ver. 2.14.608 2017-07-19 16:39:34 +03:00
Milan Hanajik 218a14acca PETERBURG_xy -> PETERSBURG_xy 2017-07-19 16:39:01 +03:00
Milan Hanajik 1f978844c0 Draining can be stopped by drain buttons, not by STOP button. 2017-07-19 16:38:46 +03:00
Milan Hanajik ca80c1e49d BenchControlPanel supports Drain buttons highlighting (3 states). 2017-07-19 08:00:51 +02:00
Milan Hanajik 9bf66f651a Buoyancy is 1.00103, not 1001.03 2017-07-19 07:53:52 +02:00
Milan Hanajik a94ebc747a ver. 2.14.604 2017-07-18 10:00:31 +02:00
Milan Hanajik 77a6aff593 iPerl communication changes (completed as in branch 12 - Greece). 2017-07-18 08:43:16 +02:00
Milan Hanajik f58bc38450 ver. 2.14.603 2017-07-16 19:42:50 +02:00
Milan Hanajik bb962ad3b7 iPerl communication changes (in progress). 2017-07-14 17:13:07 +02:00
Milan Hanajik dbdbda77b3 Something 2017-07-14 17:13:01 +02:00
Milan Hanajik cafdffd647 (1) LU-logging changes, (2) Oracle DB changes for Greece - saving average results from multiple tests. 2017-07-14 16:31:05 +02:00
Milan Hanajik e076410d71 Style and minor changes. 2017-07-14 16:28:55 +02:00
Milan Hanajik 0862b265bd Procedure and Test 'Compare' in progress. 2017-07-14 16:28:18 +02:00
Milan Hanajik 803bea960d Bug fix in MettlerToledo.Standard.GetSerNumOp, ver. 2.14.602 2017-07-14 14:37:12 +02:00
Milan Hanajik 1a2c64db84 ver. 2.14.601 2017-07-12 16:38:35 +02:00
Milan Hanajik 179e673104 ver. 2.14.600 2017-07-06 14:17:53 +02:00
Milan Hanajik 3ba579e4a0 Modifications for BAHRAIN_50 2017-07-04 11:28:02 +02:00
Milan Hanajik 00a2289e92 Evaluation of Results.Entities.TestRslt.TestDone, Results.Entities.Batch.Buoyancy() etc. fixed, ver. 2.14.599 2017-07-04 11:19:05 +02:00
Milan Hanajik 34ad6f040d WMeterRsltItemSpec : Q_rise Q_fall fixed 2017-07-04 05:16:51 +02:00
Milan Hanajik 0c827d7167 Buoyancy WMeterRsltItemSpec fixed, evaluated also for a complete batch, ver. 2.14.598 2017-07-03 12:41:37 +02:00
Milan Hanajik 178af644d0 Camera detection improvement. 2017-07-03 12:40:20 +02:00
Milan Hanajik 2ea5454707 Output.FileWriters.Enhanced uses font properties, ver. 2.14.597 2017-06-30 16:42:30 +02:00
Milan Hanajik f5c5569482 Results config - new tab order, Output.Printer.Enhanced - font properties (UI) 2017-06-30 14:15:26 +02:00
Milan Hanajik a250556f9b Output.FileWriters.Xml does not use separate threads. 2017-06-30 12:43:00 +02:00
Milan Hanajik dac91b094e MainSeq modification : Purging End does not leave a measurement session, ver. 2.14.596 2017-06-30 12:04:55 +02:00
Milan Hanajik 1ef666be9e ver. 2.14.595 2017-06-29 23:10:35 +02:00
Milan Hanajik e71795bfe5 Masses, Buoyancy, Density corr. added to results, Buoyancy -> TestRslt, Dens.corr. -> Batch, MetrologyDlgDensityTab, etc. 2017-06-29 23:04:17 +02:00
Milan Hanajik 0d6a8b272a When saving a new or modified procedure there is a test of the Name uniqueness 2017-06-29 22:57:21 +02:00
Milan Hanajik 5d0b929593 Communication with scales is verified on program startup. 2017-06-29 22:57:16 +02:00
Milan Hanajik 94e5e906b1 Results.Entities.MeterTestRslt.IsPilotRslt() added to control output protocol generation. 2017-06-29 22:57:11 +02:00
Milan Hanajik 38b985c75f DataEntry.Combined.EntryForm fixed, all data entry forms simplified. 2017-06-29 11:37:18 +02:00
Milan Hanajik 49fa937074 MainSeq : CreateNewBatchResults( ) fixed for compound meters, extra checks added. Config.Data changed for BERLIN. 2017-06-29 09:21:22 +02:00
Milan Hanajik 85ead0b69e WMeterRsltItemSpec : iPerl FW Version added. 2017-06-27 14:05:17 +02:00
Milan Hanajik 22c8d6ed9d 'BatchNr' from MySQL DB used in offline mode (IsRealbench = false) 2017-06-27 11:29:52 +02:00
Milan Hanajik 7449456d55 Mettler-Toledo improvements, SerialPort.Encoding = ASCII, etc., ver. 2.14.589 2017-06-26 15:34:31 +02:00
Milan Hanajik 2fb1c44ff2 All scales support GetSerNumOp (however some return null). Reading S/N of all scales on program startup, ver. 2.14.588 2017-06-26 13:22:36 +02:00
Milan Hanajik 71e1cf47df Output.Printers.Enhanced.Printer uses a correct CultureInfo (Torino), etc., ver. 2.14.587 2017-06-23 13:40:44 +02:00
Milan Hanajik 13ddcac646 TestDone and TestPassed results items added, ver. 2.14.586 2017-06-23 12:37:10 +02:00
Milan Hanajik 3a3dc59275 Multiple file writers temporary bug fix, ver. 2.14.585 2017-06-23 10:53:01 +02:00
Milan Hanajik 76a841bc84 Output.PrintersEnhanced.EnhancedPrintDocument updated. 2017-06-23 10:52:02 +02:00
Milan Hanajik 628efe83ca Italian language fixes, ver. 2.14.584 2017-06-23 08:47:39 +02:00
Milan Hanajik 17f6f7c3be XmlSerializers created by XmlSerializer.FromType(new[] {typeof(...)})[0]; This prevents throwing an exception => better debugging. 2017-06-22 21:37:05 +02:00
Milan Hanajik 7ad8c986d7 Multi-threading bug fix in Output.FileWriters. 2017-06-22 21:36:46 +02:00
Milan Hanajik 470fc6fd07 Italian resources added. 2017-06-21 18:55:49 +02:00
Milan Hanajik b1f1c6f932 TestMethods.Adjustment forms have the control box in the upper-right corner hidden. 2017-06-21 18:29:36 +02:00
Milan Hanajik 902d596c63 RsltItems_Screen_xxx lists in ResultsTabPageCtrl initialized earlier (in the constructor), possible Torino50 bug fix). 2017-06-21 18:29:22 +02:00
Milan Hanajik cf5307d2e2 ver. 2.14.582 2017-06-21 16:04:16 +02:00
Milan Hanajik 9c663b34c7 PETERBURG_50 and KEMPNO_50 if / elif-s fixed (20 water meters instead of 6), ver. 2.14.581 2017-06-20 17:11:28 +02:00
Milan Hanajik 2ac97aa809 commonBackColor for ListView-s in ResultsTabPage, CompletedFromTests() method in Results.Entities.WaterMeter 2017-06-16 15:36:27 +02:00
Milan Hanajik ddebe7f8d5 iPerlCommunication/iPerlEnums.cs (enum Q2CorrType) added 2017-06-15 19:08:26 +02:00
Milan Hanajik 6773624cb4 MySQL DB changes for IPERL : FWVersion and FlowMean added, no conflict with FlowMin. 2017-06-15 18:59:05 +02:00
Milan Hanajik 1bf118bdb9 Generic improvements 2017-06-15 18:58:51 +02:00
Milan Hanajik c31c19ba02 Code update for STABLE_MASS_EXTRAS. 2017-06-13 09:05:53 +02:00
Milan Hanajik 05200c437e Kempno_50 component added, if/elif for KEMPNO_50 added, ver. 2.14.577 2017-06-13 08:49:06 +02:00
Milan Hanajik 750122e6ea Easytherm : temperature setpoint = 0 ... not communicated to the Easytherm (= no change) ... is the default value, ver. 2.14.576 2017-06-11 13:13:18 +02:00
Milan Hanajik 8d5c13f6d7 ITempMeter iface added to Modbus.Easytherm.Easytherm, SetReservoirTemp() added to IControlCom and used by Easytherm, Modbus uses queues, sends 1 telegram/s, ver. 2.14.575 2017-06-11 12:07:53 +02:00
Milan Hanajik 1dd399bdb9 Component upgraded : Zavretie VL11 a VL13 pri otvorenom upinaci, etc. 2017-06-11 12:02:16 +02:00
Milan Hanajik beba64242d DB bug fix. 2017-06-08 22:54:30 +02:00
Milan Hanajik 3be28f8a11 Performance improvement of automated renaming of paths and sequences. 2017-06-08 22:49:44 +02:00
Milan Hanajik d2b745dd8e Temperature Tup and Tdown can be checked in Adjustment, Endurance, FlyingStart, FlyingStartMassCollection and FixedStart methods, ver. 2.14.573 2017-06-08 16:55:24 +02:00
Milan Hanajik db55f5b3fd DB entities, mappings and UI added for 'Control water temp.', 'Temp. lim. lo' and 'Temp. lim. hi'. 2017-06-08 16:06:48 +02:00
Milan Hanajik 420c194f04 resources cleanup : Error_ removed, Control_water_temp_chdr, Temp_lim_lo_chdr, Temp_lim_hi_chdr added, etc. 2017-06-08 15:41:18 +02:00
Milan Hanajik 5cb3955903 Code cleanup : Config.Entities.TestResult, Config.Entities.MeterTestResult, ResultsPrinters.Zapiska.Printer, etc. removed. 2017-06-08 15:37:52 +02:00
Milan Hanajik 420d016ee8 Q_from and Q_to removed from three Procedure tabs. 2017-06-08 11:28:10 +02:00
Milan Hanajik f803d27882 More changes, bug fix in ResultsBrowser. 2017-06-08 10:40:52 +02:00
Milan Hanajik 21016a1500 iPerl and iPerlHead separated, iPerl removed (WaterMeter should be used instead). 2017-06-08 09:14:30 +02:00
Milan Hanajik 8a4ad1c2d4 (1) flow calculation for Start/Stop method fixed, (2) iPerl checks the new factor before writing 2017-06-07 16:22:18 +02:00
Milan Hanajik 62e562c245 DB changes : TestRslt table : TestDone, Remark, both FlowMean an FlowMin, ver. 2.14.572 2017-06-07 15:55:47 +02:00
Milan Hanajik d8c389541c Ambient values of a procedure fixed. Mean value calculated using tests times as weights. 2017-06-02 14:48:38 +02:00
Milan Hanajik f13529b339 It is not possible anymore to configure the same FileWriter or ResultsPrinter twice (Torino50 bug fix) 2017-06-01 12:40:03 +02:00
Milan Hanajik 8b195bd6a9 iPerl : signed/unsigned bug-fix : q2CorrRFlow, q2CorrLFlow 2017-06-01 12:39:59 +02:00
Milan Hanajik 082166fc78 Automated renaming of paths and transitions, part 5 (bug fix). 2017-05-30 13:26:44 +02:00
Milan Hanajik be6240bf28 Automated renaming of paths and transitions, parts 2,3,4. 2017-05-29 15:15:03 +02:00
Milan Hanajik c776cbcdf1 Previous results display fixed. 2017-05-25 17:04:13 +02:00
Milan Hanajik 294cc73e36 tstRslt.FlowMin evaluated, saved to Oracle DB only. 2017-05-25 14:06:05 +02:00
Milan Hanajik 3deb24f89a Automated renaming of paths and transition sequences, part 1. 2017-05-25 12:39:24 +02:00
Milan Hanajik 65124248cd Czech BenchControlPanel changes. 2017-05-25 10:39:39 +02:00
Milan Hanajik 750ec031d9 Results items : Tooltips added. 2017-05-24 14:58:35 +02:00
Milan Hanajik 91b750e1a0 On screen results use new style of configuration, part 2: ResultsConfigCtrl added. 2017-05-24 11:35:34 +02:00
Milan Hanajik b92d9f5a9c On screen results use new style of configuration. 2017-05-19 14:41:48 +02:00
Milan Hanajik bcaf1b4830 Old style ResultsPrinters.Basic removed. 2017-05-19 11:25:44 +02:00
Milan Hanajik 71613cba5d Q_ref_mean and many other result items added. 2017-05-19 11:25:24 +02:00
Milan Hanajik d2c21bcca4 Results, ResultsBrowser: iPerl specific results added, Passed item fixed for a water meter (it was correct only for a test). 2017-05-16 19:39:54 +02:00
Milan Hanajik d756af52d8 ver. 2.13.560 2017-05-16 13:22:41 +02:00
Milan Hanajik a6cc2cc325 PETERBURG_200 if/elif/endif-s fixed. 2017-05-16 13:14:44 +02:00
Milan Hanajik ee89de9621 Both components for Peterburg upgraded. 2017-05-16 13:08:45 +02:00
Milan Hanajik e21d9102a2 ComponentsManager: Creation of FlowMeters, TempMeters, PressureMeters, RegisterReaders and WaterMeters from a script file added. 2017-05-16 13:06:48 +02:00
Milan Hanajik c4d736b7cc Bug fix: Missing 'using' for ORACLE_DB 2017-05-16 10:01:08 +02:00
Milan Hanajik 5ed7049900 ComponentsManager : Creation of Valves, RegisterReaders and FixedStartRegisterReaders from a script file. 2017-05-15 14:03:07 +02:00
Milan Hanajik 6f6112a77c ver. 2.13.559 2017-05-12 15:06:54 +02:00
Milan Hanajik cb38a7fe5e ver. 2.13.558 2017-05-11 16:52:02 +02:00
Milan Hanajik 4c1daf55f2 SLM_PT150, PETERBURG_50, PETERBURG_200 symbols, components added, ver. 2.13.557 2017-05-11 16:41:03 +02:00
Milan Hanajik 6cace280c9 SequenceBase.LogProcessDataHeader() added. 2017-05-10 13:54:38 +02:00
Milan Hanajik 847a4d74d6 UpdateTempPressDensAmb(tstRslt) function added to SequenceBase, used by all sequences. 2017-05-10 10:43:33 +02:00
Milan Hanajik 53c3a51b47 German language, etc. 2017-05-10 09:50:16 +02:00
Milan Hanajik b557658760 PrecedureDlg : Protected check box is enabled only for a Metrologist. 2017-05-09 16:55:32 +02:00
Milan Hanajik 7d03fd4674 Procedure.Protected, Procedure.MustBeComplete Procedure.ManualCtrlDisabled, Batch.Dirty and string WaterMeter.Remark added.
ProcedureDlg implements them, ver. 2.13.555.
2017-05-05 22:25:52 +02:00
Milan Hanajik 01ad1993f1 More CoverTest, avoid interference with DataEntry forms, 'bypass' logging. 2017-05-05 22:25:45 +02:00
Milan Hanajik f0140e2bd1 TankDraining sequence conditions added (MettlerToledo scales). 2017-05-05 14:18:49 +02:00
Milan Hanajik ed83ae57c5 Progress bars are not displayed as 'completed' when a test was aborted. 2017-05-05 12:46:37 +02:00
Milan Hanajik e746d0179f BenchControlPanel modifications/layout changes. 2017-05-05 12:46:16 +02:00
Milan Hanajik 6ba2a663b4 More CoverTest (inversion, login dialog when bypasing, default values). 2017-05-05 12:45:25 +02:00
Milan Hanajik 95f14f9879 Bug fixes in: (1) Output.FileWriters, (2) MainSeq and TestProgressControls, more logging in CoverTest. 2017-05-04 22:13:33 +02:00
Milan Hanajik 2933bd24e7 CoverTest introduced. 2017-05-04 17:13:11 +02:00
Milan Hanajik 73eefe6649 Improvement: Prevents to click 'x' on YesNoForm and MessageBoxForm 2017-05-04 16:34:17 +02:00
Milan Hanajik 0f7ff301c4 Output.Printers.Enhanced component added. 2017-05-04 16:34:03 +02:00
Milan Hanajik 17c685148e (1) Flow selection in New Test Wizard extended, (2) MainSeq and BencControlPael modified, etc. 2017-05-03 22:24:25 +02:00
Milan Hanajik 54a6c1e402 ProcedureDlg ROI wizard fixed, creates Roi.ProcedureParams. 2017-05-01 16:03:47 +02:00
Milan Hanajik fa57c51786 ProcedureParams initialization/constructors modified. ProcedureParamsBase modified. 2017-05-01 16:03:45 +02:00
Milan Hanajik 8a9eba9e76 Bug when creating a new Config database fixed. 2017-05-01 11:16:23 +02:00
Milan Hanajik 59392d8bdc MakeSimulated fixed when there are multiple test repetitions, ver. 2.12.555 2017-05-01 10:28:43 +02:00
Milan Hanajik 45d35ec108 'X' button disabled on all DataEntry forms. 2017-04-28 13:04:09 +02:00
Milan Hanajik a773e42fca iPerl type checked after reading Calibration structure. 2017-04-28 12:59:02 +02:00
Milan Hanajik 80697ed65f ver. 2.12.550 2017-04-24 14:22:51 +02:00
Milan Hanajik 43fd99cea6 output.FileWriter.Enhanced copes with WaterMeters.Count==0, etc. 2017-04-24 12:21:12 +02:00
Milan Hanajik eafcf016f3 Setting regulation valves before flow setting disabled, caused porbles all the time, ver. 2.12 549 2017-04-24 11:58:57 +02:00
Milan Hanajik 5a89a5d43f ver. 2.12.548 2017-04-24 11:02:12 +02:00
Milan Hanajik 33715395dc ReadMassOp fixed, was freezing when draining tanks, ver. 2.12.547 2017-04-24 10:49:28 +02:00
Milan Hanajik 05982cc2ff Endurance test method sequence modified. 2017-04-24 09:44:11 +02:00
Milan Hanajik 6706b296c0 ver. 2.12.546 2017-04-24 08:29:51 +02:00
Milan Hanajik e4be90b7bc ver. 2.12.545 2017-04-20 15:59:35 +02:00
Milan Hanajik 9cc9e4b4c9 MainSeq change to Restore a previously saved batch results, ver. 2.12.544 2017-04-20 15:53:11 +02:00
Milan Hanajik 45869401ad BatchNr of restored session fixed, ver. 2.12.544 2017-04-20 11:00:41 +02:00
Milan Hanajik 5a88e8909f Culture parameter added to all Output.FileWriters components, ver. 2.12.543 2017-04-18 15:29:28 +02:00
Milan Hanajik a4dc7435d0 PreviousResultsCtrl modification: Reload/Restore button was hidden. 2017-04-14 11:51:37 +02:00
Milan Hanajik df1689d458 MainSeq changes, CopyContentFrom() added to WaterMeter, TestRslt, MeterTestRslt, ver. 2.12.542 2017-04-13 14:34:58 +02:00
Milan Hanajik 76a54f41a7 Results.DBase added. 2017-04-12 21:43:57 +02:00
Milan Hanajik 89593b1dac 'Custom'/'Oprav DEWY' button added to BenchControlPanel, MainSeq changes 2017-04-12 17:59:48 +02:00
Milan Hanajik dbd6b7a9f7 SeqBase bug fixes. 2017-04-12 17:37:55 +02:00
Milan Hanajik e49fcdebfc ver. 2.12.539 2017-04-11 17:37:04 +02:00
Milan Hanajik 1ccdcf9bd2 Possibility to reload previous results, MainSeq modified - CreateNewBatchResults() and RestoreBatchResults(), ver. 2.12.538 2017-04-11 17:31:48 +02:00
Milan Hanajik 60f5359bd9 Culture invariant procedure import/export, ver. 2.12.537 2017-04-11 12:54:37 +02:00
Milan Hanajik 71cc77bee1 Keithley.Multimeter_2010_RS232.Multimeter shut-down bug fix, ver. 2.12.536 2017-04-10 15:06:56 +02:00
Milan Hanajik 460b40c9cd ver. 2.12.535 2017-04-10 12:04:04 +02:00
Milan Hanajik c2e32c774e RoiDetecion wizard forms added to TestWizard, ver. 2.12.534 2017-04-10 11:53:41 +02:00
Milan Hanajik 796d9fa554 Camera.Display.DisplayForm modifications 2017-04-09 14:10:49 +02:00
Milan Hanajik 8a8c6c9997 Camera measurement speed optimized, ver. 2.12.533 2017-04-09 13:30:30 +02:00
Milan Hanajik 6e420250b4 Possibility to switch off Telnet VirtualTerminal completely, IVirtualTerminal, DummyVT. 2017-04-07 16:04:43 +02:00
Milan Hanajik 4564f0424c Camera ; UDP listener implemented (but disabled) again, ver. 2.12.532 2017-04-07 15:49:14 +02:00
Milan Hanajik 099d635d3e RoiParams, DetectionImagesCount, P1, P2 are procedure parameters, ver. 2.12.531 2017-04-07 12:22:01 +02:00
Milan Hanajik d372a38e7d Camera time read with each sample, calculation : VolumeStart, VolumeEnd, TimestampStart, TimestampEnd used, ver. 2.12.530 2017-04-07 11:29:35 +02:00
Milan Hanajik fc26b95bdb RoiCfg.SaveImages introduced, Program.ImagesDir introduced - directory cleaned or created on program startup. 2017-04-06 23:49:51 +02:00
Milan Hanajik 44735260ce CLP1611 Measurement done only on successfully detected ROI-s, ver. 2.12.530 2017-04-06 23:47:24 +02:00
Milan Hanajik 6aa3cd96a6 RoiDetection : Changes while testing, ver. 2.12.528 2017-04-06 18:00:33 +02:00
Milan Hanajik e1eb582804 RoiDetection : Images/cameras for retry of ROI Detection can be selected, ver. 2.12.527 2017-04-06 16:54:27 +02:00
Milan Hanajik 0ad4847972 Network.Camera.Display and ICameraDisplay added, ver. 2.12.526 2017-04-06 15:17:56 +02:00
Milan Hanajik 323f2ede25 RoiDetectionOp modified : File transfer correctly initiated. 2017-04-06 10:27:21 +02:00
Milan Hanajik a64c547395 Output.FileWriters.Xml modifications, ver. 2.12.525 2017-04-06 08:29:03 +02:00
Milan Hanajik 40f5079846 MeasurementOp.cs deleted, MeasurementOp in Network/Camera/CLP1611/Camera.cs 2017-04-05 22:22:41 +02:00
Milan Hanajik 464dfc6dd1 FlyingStartMassCollection : 'Next' button can be used to stop the test. 2017-04-05 22:01:21 +02:00
Milan Hanajik c1b3cdde6d Camera bug fix 2017-04-05 22:00:01 +02:00
Milan Hanajik e688c4ba25 Speisung -> Wasserzulauf 2017-04-05 20:32:39 +02:00
Milan Hanajik 592823aa10 Program shutdown cleaned-up : StopOperations(), StopDevice() called appropriately. 2017-04-05 19:45:21 +02:00
Milan Hanajik 5ad871a7e0 Procedure 'Export' / 'Import' implemented, ver. 2.12.524 2017-04-03 14:24:35 +02:00
Milan Hanajik 049bbc8655 DEWA Q2 correction modified, Results.Entities.WaterMeter columns added (iPerl only). 2017-03-31 14:17:18 +02:00
Milan Hanajik dcf6df293f Changes agreed with Mr. Kolesnik in BWB, ver. 2.12.521 2017-03-30 12:38:50 +02:00
Milan Hanajik 0dd2245fe6 Berlin component upgraded 2017-03-29 12:45:14 +02:00
Milan Hanajik cd750cca2f Bug in DataEntry.Standard6.CycleEndForm fixed (end states, Berlin), ver. 2.12.520 2017-03-29 11:54:07 +02:00
Milan Hanajik 5f2da63339 Drain valve removed from Output path, outPath.Scale.DrainValve used instead of outPath.DrainValve, wait for Event. BalanceDone before 2nd mass measurement in FlyingStartMassCollection, ver. 2.12.519 2017-03-29 09:22:39 +02:00
Milan Hanajik d420128b4b Draining modified, in BERLIN done always before flow setting, ver. 2.12.518 2017-03-28 23:54:52 +02:00
1567 changed files with 126828 additions and 43301 deletions
+6 -2
View File
@@ -4,12 +4,16 @@ DeviceTest/bin/
DeviceTest/obj/
Dirichlet.Numerics/bin
Dirichlet.Numerics/obj
GraphLib/bin
GraphLib/obj
MonitoringDB/bin
MonitoringDB/obj
Results/bin/
Results/obj/
ResultsBrowser/bin/
ResultsBrowser/obj/
TestBenchFramework/bin/
TestBenchFramework/obj/
TBF/bin/
TBF/obj/
TBFSetup/Debug/
TBFSetup/Release/
Users/bin/
+4 -6
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;GENESIS;IPERL;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;MUNICH</DefineConstants>
<DefineConstants>TRACE;GENESIS;IPERL;LANG_DE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -75,15 +75,14 @@
<Compile Include="Entities\Group.cs" />
<Compile Include="Entities\HeatMetersPath.cs" />
<Compile Include="Entities\IHasItemNr.cs" />
<Compile Include="Entities\IHasName.cs" />
<Compile Include="Entities\IHasValves.cs" />
<Compile Include="Entities\MeasurementCorrection.cs" />
<Compile Include="Entities\MetersPath.cs" />
<Compile Include="Entities\MeterTestResult.cs" />
<Compile Include="Entities\OutputPath.cs" />
<Compile Include="Entities\Procedure.cs" />
<Compile Include="Entities\ProcedureHistory.cs" />
<Compile Include="Entities\Test.cs" />
<Compile Include="Entities\TestResult.cs" />
<Compile Include="Entities\TransitionSequence.cs" />
<Compile Include="Entities\TransitionStep.cs" />
<Compile Include="Entities\User.cs" />
@@ -101,11 +100,9 @@
<Compile Include="Mappings\HeatMetersPathMap.cs" />
<Compile Include="Mappings\MeasurementCorrectionMap.cs" />
<Compile Include="Mappings\MetersPathMap.cs" />
<Compile Include="Mappings\MeterTestResultMap.cs" />
<Compile Include="Mappings\OutputPathMap.cs" />
<Compile Include="Mappings\ProcedureMap.cs" />
<Compile Include="Mappings\TestMap.cs" />
<Compile Include="Mappings\TestResultMap.cs" />
<Compile Include="Mappings\TransitionSequenceMap.cs" />
<Compile Include="Mappings\TransitionStepMap.cs" />
<Compile Include="Mappings\UserMap.cs" />
@@ -124,6 +121,7 @@
<ItemGroup>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<SubType>Designer</SubType>
+11 -5
View File
@@ -14,30 +14,36 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_VELKA_TRAT
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || BERLIN
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif TORINO50 || BADGER_MALA_TRAT
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40
public const int WMsCount = 20;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif RUM_MOB
public const int WMsCount = 8;
public const int LineSize = 8;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_IPERL
public const int WMsCount = 40;
public const int LineSize = 20;
+5 -4
View File
@@ -1,18 +1,19 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class BenchPath : IHasItemNr, IHasValves
public class BenchPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string TempMtrUp { get; set; }
public virtual string TempMtrDown { get; set; }
public virtual string PressMtrUp { get; set; }
+56 -1
View File
@@ -3,10 +3,12 @@
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
public class Component : IHasItemNr
public class Component : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
@@ -53,6 +55,59 @@ namespace Config.Entities
return result;
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(Name);
output.WriteLine(ClassName);
output.WriteLine(ParentName);
output.WriteLine(Mode.ToString());
output.WriteLine(Logging.ToString());
output.Write(Parameters);
output.Close();
}
public static Component Import(StreamReader input)
{
Component result = new Component();
result.Name = input.ReadLine();
result.ClassName = input.ReadLine();
result.ParentName = input.ReadLine();
string line = input.ReadLine();
if (line.Equals(DebugMode.DetectedOff.ToString())) result.Mode = DebugMode.DetectedOff;
else if (line.Equals(DebugMode.DetectedOn.ToString())) result.Mode = DebugMode.DetectedOn;
else if (line.Equals(DebugMode.Normal.ToString())) result.Mode = DebugMode.Normal;
else if (line.Equals(DebugMode.AutoDetect.ToString())) result.Mode = DebugMode.AutoDetect;
else if (line.Equals(DebugMode.FailureDuringOperation.ToString())) result.Mode = DebugMode.FailureDuringOperation;
else if (line.Equals(DebugMode.Off.ToString())) result.Mode = DebugMode.Off;
else if (line.Equals(DebugMode.Record.ToString())) result.Mode = DebugMode.Record;
else if (line.Equals(DebugMode.Reply.ToString())) result.Mode = DebugMode.Reply;
else if (line.Equals(DebugMode.Simulate.ToString())) result.Mode = DebugMode.Simulate;
else if (line.Equals(DebugMode.Inherit.ToString())) result.Mode = DebugMode.Inherit;
line = input.ReadLine();
if (line.Equals(LogLevel.Off.ToString())) result.Logging = LogLevel.Off;
else if (line.Equals(LogLevel.Fatal.ToString())) result.Logging = LogLevel.Fatal;
else if (line.Equals(LogLevel.Error.ToString())) result.Logging = LogLevel.Error;
else if (line.Equals(LogLevel.Warn.ToString())) result.Logging = LogLevel.Warn;
else if (line.Equals(LogLevel.Info.ToString())) result.Logging = LogLevel.Info;
else if (line.Equals(LogLevel.Debug.ToString())) result.Logging = LogLevel.Debug;
else if (line.Equals(LogLevel.All.ToString())) result.Logging = LogLevel.All;
result.Parameters = string.Empty;
line = input.ReadLine();
while (line != null)
{
result.Parameters += line;
result.Parameters += Environment.NewLine;
line = input.ReadLine();
}
return result;
}
public virtual string ToString(string indent)
{
string result = string.Empty;
+25 -3
View File
@@ -1,6 +1,9 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.IO;
namespace Config.Entities
{
public class ComponentProcedure
@@ -10,13 +13,32 @@ namespace Config.Entities
public virtual string Parameters { get; set; }
public virtual Procedure Procedure { get; set; }
public virtual ComponentProcedure Clone()
public virtual ComponentProcedure Clone(Procedure newProcedure)
{
ComponentProcedure result = new ComponentProcedure();
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Procedure = Procedure;
result.Procedure = newProcedure;
return result;
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(CmpntName);
output.WriteLine(Parameters.Replace(Environment.NewLine, "~"));
}
public static ComponentProcedure Import(StreamReader input, Procedure newProcedure)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return null;
ComponentProcedure result = new ComponentProcedure();
result.CmpntName = firstLine;
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine);
result.Procedure = newProcedure;
return result;
}
}
}
+24 -2
View File
@@ -1,6 +1,9 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.IO;
namespace Config.Entities
{
public class ComponentTest
@@ -18,5 +21,24 @@ namespace Config.Entities
result.Test = Test;
return result;
}
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(CmpntName);
output.WriteLine(Parameters.Replace(Environment.NewLine, "~"));
}
public static ComponentTest Import(StreamReader input, Test newTest)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return null;
ComponentTest result = new ComponentTest();
result.CmpntName = firstLine;
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine);
result.Test = newTest;
return result;
}
}
}
+81 -18
View File
@@ -42,16 +42,29 @@ namespace Config.Entities
{
Active,
History,
Template,
Count,
}
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
Single,
Combined,
HeatMeter,
#if LANG_DE
[Description("Wasserzähler")] Single,
[Description("Verbundwasserzähler")] Combined,
[Description("Wärmezähler")] HeatMeter,
#elif LANG_CS
[Description("Vodoměry")] Single,
[Description("Kombinované vodoměry")] Combined,
[Description("Měřiče tepla")] HeatMeter,
#elif LANG_RU
[Description("Счетчик")] Single,
[Description("Комбинированный счетчик")] Combined,
[Description("Счетчик тепла")] HeatMeter,
#else
[Description("Water meters")] Single,
[Description("Compound water meters")] Combined,
[Description("Heat meters")] HeatMeter,
#endif
}
public enum CompoundMeterId : byte
@@ -75,14 +88,13 @@ namespace Config.Entities
public enum Mounting
{
[Description("")] NotSpecified,
#if LANG_DE
[Description("")] NotSpecified,
[Description("H")] H, /// horizontal
[Description("V")] V, /// vertical
[Description("STR")] S, /// standrohre
[Description("F")] F, /// fall
[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
@@ -158,31 +170,38 @@ namespace Config.Entities
public enum Publish : sbyte
{
#if LANG_DE
/// nemecky
/// german
[Description("nie")] Never = 0,
[Description("immer")] Always = 1,
[Description("Bildschirm")] OnScreen = 2,
[Description("intern")] Internal = 3,
#elif LANG_CS
/// cesky
/// czech
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interně")] Internal = 3,
#elif LANG_SK
/// slovensky
/// slovak
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interne")] Internal = 3,
#elif LANG_PL
/// polsky
/// polish
[Description("nigdy")] Never = 0,
[Description("zawsze")] Always = 1,
[Description("na ekranie")] OnScreen = 2,
[Description("wewnętrznie")] Internal = 3,
#elif LANG_RU
/// russian
[Description("никогда")] Never = 0,
[Description("всегда")] Always = 1,
[Description("толька экран")] OnScreen = 2,
[Description("внутренно")] Internal = 3,
#else
[Description("Never")] Never = 0,
/// english
[Description("Never")] Never = 0,
[Description("Always")] Always = 1,
[Description("On screen")] OnScreen = 2,
[Description("Internal")] Internal = 3,
@@ -227,10 +246,11 @@ namespace Config.Entities
public enum Progress
{
JustStarted,
TransitionBefore,
TransitionBefore,
SwitchingFlowDetection,
FlowSetting,
Test,
Aborted, /// Use as an argument when a test was aborted
Test,
TransitionAfter,
Completed,
Count,
@@ -353,5 +373,48 @@ namespace Config.Entities
#endif
Count
}
}
public enum ImageRotation
{
[Description("0 deg")] None,
[Description("90 deg")] Deg90,
[Description("180 deg")] Deg180,
[Description("270 deg")] Deg270,
Count
}
public enum CameraDisplayResolution
{
Small,
Medium,
Large,
// FullScreen,
Count,
}
public enum ErrorFlagsMode : sbyte
{
#if LANG_DE
[Description("aus")] Off,
[Description("info")] Info,
[Description("ein")] On,
#elif LANG_CS
[Description("vypnuto")] Off,
[Description("info")] Info,
[Description("zapnuto")] On,
#elif LANG_RU
[Description("выкл")] Off,
[Description("инфо")] Info,
[Description("вкл")] On,
#elif LANG_PL
[Description("nie")] Off,
[Description("info")] Info,
[Description("tak")] On,
#else // LANG_EN
[Description("off")] Off,
[Description("info")] Info,
[Description("on")] On,
#endif
Count
}
}
+3 -2
View File
@@ -1,16 +1,17 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class FeedingPath : IHasItemNr, IHasValves
public class FeedingPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string Pump { get; set; }
+12 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
@@ -10,5 +10,15 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual int Gid { get; set; }
public virtual string Name { get; set; }
}
public Group()
{
}
public Group(int gid, string name)
{
Gid = gid;
Name = name;
}
}
}
+3 -2
View File
@@ -1,15 +1,16 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Metering Systems
///
using System;
namespace Config.Entities
{
public class HeatMetersPath : IHasItemNr
public class HeatMetersPath : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float TempWarmFrom { get; set; } /// Warm temperature range from [°C]
public virtual float TempWarmTo { get; set; } /// Warm temperature range to [°C]
+11
View File
@@ -0,0 +1,11 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
namespace Config.Entities
{
public interface IHasName
{
int Id { get; }
string Name { get; set; }
}
}
+9 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
@@ -8,7 +8,15 @@ namespace Config.Entities
public class MeasurementCorrection
{
public virtual int Id { get; protected set; }
public virtual int RangeIx { get; set; } /// 0..5
public virtual float Measurement { get; set; }
public virtual float Correction { get; set; }
public MeasurementCorrection() { }
public MeasurementCorrection(int rangeIx)
{
RangeIx = rangeIx;
}
}
}
-67
View File
@@ -1,67 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
namespace Config.Entities
{
public class MeterTestResult
{
public virtual int Id { get; protected set; }
public virtual TestResult TestResult { get; set; } /// reference to the TestResult entity
public virtual bool Disabled { get; set; } /// true = this meter was disabled and the results should be disregarded
public virtual string SerialNr { get; set; }
public virtual string EndState { get; set; }
public virtual float VolumeStart { get; set; } /// liter
public virtual float VolumeEnd { get; set; } /// liter
public virtual float VolumeMeter { get; set; } /// liter
public virtual float VolumeRef { get; set; } /// liter
public virtual float VolumeErrorPct { get; set; } /// %
public virtual float PulsesMeter { get; set; } /// # of pulses
public virtual float PulsesPerLiter { get; set; } /// Pulses per liter
public virtual float PulsesMaster { get; set; }
public virtual float Time { get; set; } /// sec.
public virtual float TimeStart { get; set; } /// sec. - Not mapped to DB !!!
public virtual float TimeEnd { get; set; } /// sec. - Not mapped to DB !!!
public virtual int CalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
public virtual double Q2Correction { get; set; } /// iPerl Q2 correction used during the test - Not mapped to DB !!!
public virtual bool Passed { get; set; } /// true=test passed - Not mapped to DB !!!
public MeterTestResult()
{
PulsesPerLiter = 1.0f;
}
public MeterTestResult(TestResult testResult)
: this()
{
TestResult = testResult;
}
public virtual MeterTestResult Clone(TestResult testResult)
{
MeterTestResult result = new MeterTestResult(testResult);
result.Disabled = Disabled;
result.SerialNr = SerialNr;
result.EndState = EndState;
result.VolumeStart = VolumeStart;
result.VolumeEnd = VolumeEnd;
result.VolumeMeter = VolumeMeter;
result.VolumeRef = VolumeRef;
result.VolumeErrorPct = VolumeErrorPct;
result.PulsesMeter = PulsesMeter;
result.PulsesPerLiter = PulsesPerLiter;
result.PulsesMaster = PulsesMaster;
result.Time = Time;
result.TimeStart = TimeStart;
result.TimeEnd = TimeEnd;
result.CalibFactor = CalibFactor;
result.Q2Correction = Q2Correction;
result.Passed = Passed;
return result;
}
}
}
+3 -2
View File
@@ -1,16 +1,17 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class MetersPath : IHasItemNr
public class MetersPath : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
/// Sensors
public virtual string Sensor1 { get; set; }
+9 -8
View File
@@ -1,26 +1,27 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class OutputPath : IHasItemNr, IHasValves
public class OutputPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string RegulValve { get; set; }
public virtual string FlowMeter { get; set; }
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
public virtual string StartValve { get; set; }
public virtual string Diverter { get; set; }
public virtual string TempDiv { get; set; }
public virtual string Balance { get; set; }
public virtual string EmptyTankValve { get; set; }
public virtual string Scale { get; set; }
public virtual string EmptyTankValve { get; set; } /// Not used anywhere
/// Valves
public virtual string ValvesOpen { get; set; }
@@ -54,7 +55,7 @@ namespace Config.Entities
result.StartValve = StartValve;
result.Diverter = Diverter;
result.TempDiv = TempDiv;
result.Balance = Balance;
result.Scale = Scale;
result.EmptyTankValve = EmptyTankValve;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
+135 -15
View File
@@ -1,15 +1,17 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
/// <summary>
/// Stores one test procedure, supports revisions and history log
/// </summary>
public class Procedure : IHasItemNr
public class Procedure : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
@@ -25,11 +27,13 @@ namespace Config.Entities
public virtual ProcedureState ProcedureState { get; set; }
public virtual int Revision { get; set; }
public virtual int PredecessorId { get; set; }
public virtual bool ObtainedByCopy { get; set; }
///
public virtual MetersKind MetersKind { get; set; }
public virtual bool ObtainedByCopy { get; set; } /// Initial version of this procedure was a copy of another procedure
///
public virtual MetersKind MetersKind { get; set; } /// single / compound / heat meters
public virtual string Watermeters { get; set; } /// Water meter name or Id
public virtual string ProtocolTitle { get; set; } /// Title of the printed and saved protocol
public virtual bool Protected { get; set; } /// true = procedure cannot be changed by a testing specialist
public virtual bool MustBeComplete { get; set; } /// true = procedure can be finished just when all tests were finished
public virtual bool ManualCtrlDisabled { get; set; } /// true = manual control of valves, etc. is disabled
public virtual string DataEntry { get; set; } /// Component to use for data entry
public virtual string ResultsPrinter { get; set; } /// Component to use for printing the results
@@ -37,12 +41,12 @@ namespace Config.Entities
public virtual string TransitionStart { get; set; }
public virtual string TransitionEnd { get; set; }
public virtual string AltProcName { get; set; } /// Alternative procedure name (null or string.Empty = no alt. procedure)
public virtual int AltProcPeriod { get; set; } /// Period of alternative procedures (0 = no alt. procedure)
public virtual IList<ComponentProcedure> MoreParams { get; set; }
public virtual IList<Test> Tests { get; set; }
////public virtual string MetrologicalClass { get; set; }
////public virtual IList<WMType> WMTypes { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Procedure()
@@ -58,7 +62,9 @@ namespace Config.Entities
LastChgUser = CreationUser;
LastChgTime = CreationTime;
MetersKind = Entities.MetersKind.Single;
ProtocolTitle = "Watermeter test protocol";
Watermeters = string.Empty;
Description = string.Empty;
LongDescription = string.Empty;
}
public Procedure(string name, int itemNr)
@@ -88,23 +94,137 @@ namespace Config.Entities
result.MetersKind = MetersKind;
result.Watermeters = Watermeters;
result.ProtocolTitle = ProtocolTitle;
result.Protected = Protected;
result.MustBeComplete = MustBeComplete;
result.ManualCtrlDisabled = ManualCtrlDisabled;
result.DataEntry = DataEntry;
result.ResultsPrinter = ResultsPrinter;
result.ResultsWriter = ResultsWriter;
result.TransitionStart = TransitionStart;
result.TransitionEnd = TransitionEnd;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone(result)); }
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
//result.MetrologicalClass = MetrologicalClass;
//result.WMType = WMType.Clone();
return result;
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(ItemNr.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Name);
output.WriteLine(Description);
output.WriteLine(CreationUser);
output.WriteLine(CreationTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(LastChgUser);
output.WriteLine(LastChgTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(MetersKind.ToString());
output.WriteLine(Watermeters);
output.WriteLine(Protected.ToString());
output.WriteLine(MustBeComplete.ToString());
output.WriteLine(ManualCtrlDisabled.ToString());
output.WriteLine(DataEntry);
output.WriteLine(ResultsPrinter);
output.WriteLine(ResultsWriter);
output.WriteLine(TransitionStart);
output.WriteLine(TransitionEnd);
foreach (var prms in MoreParams) { prms.Export(output); }
output.WriteLine();
foreach (var test in Tests) { test.Export(output); }
output.WriteLine();
output.Close();
}
public static Procedure Import(StreamReader input)
{
Procedure result = new Procedure();
result.ItemNr = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.Name = input.ReadLine();
result.Description = input.ReadLine();
result.CreationUser = input.ReadLine();
result.CreationTime = DateTime.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.LastChgUser = input.ReadLine();
result.LastChgTime = DateTime.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
string line = input.ReadLine();
result.MetersKind = line.Equals(MetersKind.Single.ToString()) ? MetersKind.Single : (line.Equals(MetersKind.Combined.ToString()) ? MetersKind.Combined : MetersKind.HeatMeter);
result.Watermeters = input.ReadLine();
result.Protected = bool.Parse(input.ReadLine());
result.MustBeComplete = bool.Parse(input.ReadLine());
result.ManualCtrlDisabled = bool.Parse(input.ReadLine());
result.DataEntry = input.ReadLine();
result.ResultsPrinter = input.ReadLine();
result.ResultsWriter = input.ReadLine();
result.TransitionStart = input.ReadLine();
result.TransitionEnd = input.ReadLine();
while(true)
{
ComponentProcedure prms = ComponentProcedure.Import(input, result);
if (prms == null)
break;
else
result.MoreParams.Add(prms);
}
while (true)
{
Test tst = Test.Import(input, result);
if (tst == null)
break;
else
result.Tests.Add(tst);
}
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
const string fmt = "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
ln = inp.ReadLine(); /// skip ItemNr
ln = inp.ReadLine(); if (ln != Name) { diff.AppendFormat(fmt, "Name", Name, ln); };
ln = inp.ReadLine(); if (ln != Description) { diff.AppendFormat(fmt, "Description", Description, ln); };
ln = inp.ReadLine(); /// skip CreationUser
ln = inp.ReadLine(); /// skip CreationTime
ln = inp.ReadLine(); /// skip LastChgUser
ln = inp.ReadLine(); /// skip LastChgTime
ln = inp.ReadLine(); if (ln != MetersKind.ToString()) { diff.AppendFormat(fmt, "MetersKind", MetersKind, ln); };
ln = inp.ReadLine(); if (ln != Watermeters) { diff.AppendFormat(fmt, "Watermeters", Watermeters, ln); };
ln = inp.ReadLine(); if (ln != Protected.ToString()) { diff.AppendFormat(fmt, "Protected", Protected, ln); };
ln = inp.ReadLine(); if (ln != MustBeComplete.ToString()) { diff.AppendFormat(fmt, "MustBeComplete", MustBeComplete, ln); };
ln = inp.ReadLine(); if (ln != ManualCtrlDisabled.ToString()) { diff.AppendFormat(fmt, "ManualCtrlDisabled", ManualCtrlDisabled, ln); };
ln = inp.ReadLine(); if (ln != DataEntry) { diff.AppendFormat(fmt, "DataEntry", DataEntry, ln); };
ln = inp.ReadLine(); if (ln != ResultsPrinter) { diff.AppendFormat(fmt, "ResultsPrinter", ResultsPrinter, ln); };
ln = inp.ReadLine(); if (ln != ResultsWriter) { diff.AppendFormat(fmt, "ResultsWriter", ResultsWriter, ln); };
ln = inp.ReadLine(); if (ln != TransitionStart) { diff.AppendFormat(fmt, "TransitionStart", TransitionStart, ln); };
ln = inp.ReadLine(); if (ln != TransitionEnd) { diff.AppendFormat(fmt, "TransitionEnd", TransitionEnd, ln); };
/// TODO Compare componentprocedure-s
while (ComponentProcedure.Import(inp, null) != null)
{
}
//foreach (var test in Tests)
//{
// string testDiff = test.Compare(inp);
// if (testDiff.Contains(
//}
//bool extraTestsInFile = true;
//while (Test.Import(inp, null) != null) { extraTestsInFile = true; }
return diff.ToString();
}
public override string ToString()
{
return string.Format("{0}, rev.{1}", Name, Revision);
+236 -27
View File
@@ -1,35 +1,39 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Author: Milan Hanajik
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
/// <summary>
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
/// </summary>
public class Test : IHasItemNr
public class Test : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool DoEvaluate { get; set; }
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) or 1=class1, 2=class2, 3=class3
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) or -Qn in m3/h
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual int Repeats { get; set; }
public virtual bool Emptying { get; set; }
public virtual bool Zeroing { get; set; }
public virtual bool DoDraining { get; set; }
public virtual bool DoZeroing { get; set; }
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
@@ -66,10 +70,13 @@ namespace Config.Entities
/// Default values
///
Publish = (sbyte)Config.Entities.Publish.Always;
Evaluate = true;
DoEvaluate = true;
Repeats = 1;
Emptying = false;
Zeroing = false;
DoDraining = false;
DoZeroing = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
@@ -103,14 +110,21 @@ namespace Config.Entities
result.Part = Part;
result.Publish = Publish;
result.Evaluate = Evaluate;
result.DoEvaluate = DoEvaluate;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Volume = Volume;
result.TstTime = TstTime;
result.Method = Method;
result.ErrLimLo = ErrLimLo;
result.ErrLimHi = ErrLimHi;
result.Uncertainty = Uncertainty;
result.Repeats = Repeats;
result.Emptying = Emptying;
result.Zeroing = Zeroing;
result.DoDraining = DoDraining;
result.DoZeroing = DoZeroing;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PumpPower = PumpPower;
result.MassRepeats = MassRepeats;
result.MassSpread = MassSpread;
@@ -119,10 +133,6 @@ namespace Config.Entities
result.TimeFlow2Mass = TimeFlow2Mass;
result.TimePump2StartV = TimePump2StartV;
result.TimeStop2Mass = TimeStop2Mass;
result.Method = Method;
result.ErrLimLo = ErrLimLo;
result.ErrLimHi = ErrLimHi;
result.Uncertainty = Uncertainty;
result.TolerRed = TolerRed;
result.RedType = RedType;
result.FeedingPath = FeedingPath;
@@ -141,11 +151,210 @@ namespace Config.Entities
return result;
}
public virtual void Export(StreamWriter output)
{
CultureInfo ci = CultureInfo.InvariantCulture;
output.WriteLine(Name);
output.WriteLine(Part.ToString(ci));
output.WriteLine(Publish.ToString(ci));
output.WriteLine(DoEvaluate.ToString());
output.WriteLine(Qfrom.ToString(ci));
output.WriteLine(Qto.ToString(ci));
output.WriteLine(Volume.ToString(ci));
output.WriteLine(TstTime.ToString(ci));
output.WriteLine(Method);
output.WriteLine(ErrLimLo.ToString(ci));
output.WriteLine(ErrLimHi.ToString(ci));
output.WriteLine(Uncertainty.ToString(ci));
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoZeroing.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(MassRepeats.ToString(ci));
output.WriteLine(MassSpread.ToString(ci));
output.WriteLine(((byte)MassMethod).ToString(ci));
output.WriteLine(TimeBeforeFlow.ToString(ci));
output.WriteLine(TimeFlow2Mass.ToString(ci));
output.WriteLine(TimePump2StartV.ToString(ci));
output.WriteLine(TimeStop2Mass.ToString(ci));
output.WriteLine(FeedingPath);
output.WriteLine(BenchPath);
output.WriteLine(OutputPath);
output.WriteLine(MetersPath);
output.WriteLine(RelTransBefore);
output.WriteLine(RelTransBetween);
output.WriteLine(RelTransAfter);
output.WriteLine(TransitionAfter);
foreach (var prms in MoreParams) { prms.Export(output); }
output.WriteLine();
}
public static Test Import(StreamReader input, Procedure newProcedure)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine))
{
return null;
}
CultureInfo ci = CultureInfo.InvariantCulture;
Test tst = new Test();
tst.Name = firstLine;
tst.Part = int.Parse(input.ReadLine(), ci);
tst.Publish = sbyte.Parse(input.ReadLine(), ci);
tst.DoEvaluate = bool.Parse(input.ReadLine());
tst.Qfrom = float.Parse(input.ReadLine(), ci);
tst.Qto = float.Parse(input.ReadLine(), ci);
tst.Volume = float.Parse(input.ReadLine(), ci);
tst.TstTime = float.Parse(input.ReadLine(), ci);
tst.Method = input.ReadLine();
tst.ErrLimLo = float.Parse(input.ReadLine(), ci);
tst.ErrLimHi = float.Parse(input.ReadLine(), ci);
tst.Uncertainty = float.Parse(input.ReadLine(), ci);
tst.Repeats = int.Parse(input.ReadLine(), ci);
tst.DoDraining = bool.Parse(input.ReadLine());
tst.DoZeroing = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.MassRepeats = int.Parse(input.ReadLine(), ci);
tst.MassSpread = float.Parse(input.ReadLine(), ci);
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine(), ci);
tst.TimeBeforeFlow = int.Parse(input.ReadLine(), ci);
tst.TimeFlow2Mass = int.Parse(input.ReadLine(), ci);
tst.TimePump2StartV = int.Parse(input.ReadLine(), ci);
tst.TimeStop2Mass = int.Parse(input.ReadLine(), ci);
tst.FeedingPath = input.ReadLine();
tst.BenchPath = input.ReadLine();
tst.OutputPath = input.ReadLine();
tst.MetersPath = input.ReadLine();
tst.RelTransBefore = input.ReadLine();
tst.RelTransBetween = input.ReadLine();
tst.RelTransAfter = input.ReadLine();
tst.TransitionAfter = input.ReadLine();
while (true)
{
ComponentTest prms = ComponentTest.Import(input, tst);
if (prms == null)
break;
else
tst.MoreParams.Add(prms);
}
tst.Procedure = newProcedure;
return tst;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
string fmt = string.Format("Test {0} : ", Name) + "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
CultureInfo ci = CultureInfo.InvariantCulture;
string firstLine = inp.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return string.Format("Test {0} is missing in the file\r\n", Name);
if (Name != firstLine) { diff.AppendFormat(fmt, "Name", Name, firstLine); };
ln = inp.ReadLine(); if (ln != Part.ToString(ci)) { diff.AppendFormat(fmt, "Part", Part.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Publish.ToString(ci)) { diff.AppendFormat(fmt, "Publish", Publish.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoEvaluate.ToString(ci)) { diff.AppendFormat(fmt, "Evaluate", DoEvaluate.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qfrom.ToString(ci)) { diff.AppendFormat(fmt, "Qfrom", Qfrom.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qto.ToString(ci)) { diff.AppendFormat(fmt, "Qto", Qto.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TstTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TstTime.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); };
ln = inp.ReadLine(); if (ln != ErrLimLo.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimLo", ErrLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoZeroing.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoZeroing.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != PumpPower.ToString(ci)) { diff.AppendFormat(fmt, "PumpPower", PumpPower.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassRepeats.ToString(ci)) { diff.AppendFormat(fmt, "MassRepeats", MassRepeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassSpread.ToString(ci)) { diff.AppendFormat(fmt, "MassSpread", MassSpread.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ((byte)MassMethod).ToString(ci)) { diff.AppendFormat(fmt, "MassMethod", ((byte)MassMethod).ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimeBeforeFlow.ToString(ci)) { diff.AppendFormat(fmt, "TimeBeforeFlow", TimeBeforeFlow.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimeFlow2Mass.ToString(ci)) { diff.AppendFormat(fmt, "TimeFlow2Mass", TimeFlow2Mass.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimePump2StartV.ToString(ci)) { diff.AppendFormat(fmt, "TimePump2StartV", TimePump2StartV.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TimeStop2Mass.ToString(ci)) { diff.AppendFormat(fmt, "TimeStop2Mass", TimeStop2Mass.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != FeedingPath) { diff.AppendFormat(fmt, "FeedingPath", FeedingPath, ln); };
ln = inp.ReadLine(); if (ln != BenchPath) { diff.AppendFormat(fmt, "BenchPath", BenchPath, ln); };
ln = inp.ReadLine(); if (ln != OutputPath) { diff.AppendFormat(fmt, "OutputPath", OutputPath, ln); };
ln = inp.ReadLine(); if (ln != MetersPath) { diff.AppendFormat(fmt, "MetersPath", MetersPath, ln); };
ln = inp.ReadLine(); if (ln != RelTransBefore) { diff.AppendFormat(fmt, "RelTransBefore", RelTransBefore, ln); };
ln = inp.ReadLine(); if (ln != RelTransBetween) { diff.AppendFormat(fmt, "RelTransBetween", RelTransBetween, ln); };
ln = inp.ReadLine(); if (ln != RelTransAfter) { diff.AppendFormat(fmt, "RelTransAfter", RelTransAfter, ln); };
ln = inp.ReadLine(); if (ln != TransitionAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransitionAfter, ln); };
return diff.ToString();
}
public virtual float GetErrLimLo(float flow)
{
if (ErrLimLo <= ErrLimHi)
{
return ErrLimLo; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(ErrLimLo);
float Qp = Math.Abs(ErrLimHi);
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
case 2: return -Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
case 3: return -Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
}
}
}
public virtual float GetErrLimHi(float flow)
{
if (ErrLimLo <= ErrLimHi)
{
return ErrLimHi; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(ErrLimLo);
float Qp = Math.Abs(ErrLimHi);
float Q = Math.Max(flow, 0.00001f); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.5f, 1.0f + 0.01f * Qp / Q);
case 2: return +Math.Min(5.0f, 2.0f + 0.02f * Qp / Q);
case 3: return +Math.Min(5.0f, 3.0f + 0.05f * Qp / Q);
}
}
}
public override string ToString()
{
string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty;
return string.Format("{0}(P.{1},{2}){3}", Name, ((Publish)Publish).ToString(), Evaluate ? "E" : "-", partStr);
return string.Format("{0}(P.{1},{2}){3}", Name, ((Publish)Publish).ToString(), DoEvaluate ? "E" : "-", partStr);
}
}
}
-176
View File
@@ -1,176 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class TestResult
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int BatchNr { get; set; }
public virtual string PurchaseOrder { get; set; }
public virtual MetersKind MetersKind { get; set; }
public virtual IList<MeterTestResult> Meters { get; set; }
public virtual IList<MeterTestResult> CombinedMeters { get; set; }
/// Value copied from the procedure (Entities.Procedure)
public virtual string ProcedureName { get; set; }
public virtual string ProtocolTitle { get; set; }
/// Values copied from the test (Entities.Test)
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
public virtual string TestName { get; set; }
public virtual int Part { get; set; }
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
public virtual float Qfrom { get; set; } /// [m3/h] Water flow low limit
public virtual float Qto { get; set; } /// [m3/h] Water flow high limit
public virtual float Volume { get; set; } /// [l] Target test volume
public virtual float TstTime { get; set; } /// [s] Test time estimate
public virtual int Repeats { get; set; }
public virtual bool Emptying { get; set; }
public virtual bool Zeroing { get; set; }
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int Time2MassMsrmt { get; set; }
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// [%] Lower error limit (usually < 0)
public virtual float ErrLimHi { get; set; } /// [%] Upper error limit (usually > 0)
public virtual float Uncertainty { get; set; } /// [%] Makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
/// To be replaced by the virtual bench component parameters
public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
public virtual string MetersPath { get; set; }
/// Results
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
public virtual float AmbientTempAve { get; set; } /// [deg.C] Average ambient air temperature
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
public virtual float AmbientHumiAve { get; set; } /// [%] Average ambient air relative humidity
public virtual float PressInAvrg { get; set; } /// [Bar] Input water pressure (average)
public virtual float PressInStart { get; set; } /// [Bar]
public virtual float PressInEnd { get; set; } /// [Bar]
public virtual float PressOutAvrg { get; set; } /// [Bar]
public virtual float PressOutStart { get; set; } /// [Bar]
public virtual float PressOutEnd { get; set; } /// [Bar]
public virtual float TempInAvrg { get; set; } /// [deg.C]
public virtual float TempInStart { get; set; } /// [deg.C]
public virtual float TempInEnd { get; set; } /// [deg.C]
public virtual float TempOutAvrg { get; set; } /// [deg.C]
public virtual float TempOutStart { get; set; } /// [deg.C]
public virtual float TempOutEnd { get; set; } /// [deg.C]
public virtual float TempDivAvrg { get; set; } /// [deg.C]
public virtual float TempDivStart { get; set; } /// [deg.C]
public virtual float TempDivEnd { get; set; } /// [deg.C]
public virtual float MassStartRaw { get; set; } /// [kg]
public virtual float MassStart { get; set; } /// [kg]
public virtual float MassEndRaw { get; set; } /// [kg]
public virtual float MassEnd { get; set; } /// [kg]
public virtual float MassDiff { get; set; } /// [kg]
public virtual float DensityIn { get; set; } /// [kg/m3]
public virtual float DensityOut { get; set; } /// [kg/m3]
public virtual float DensityDiv { get; set; } /// [kg/m3]
public virtual float Buoyancy { get; set; } ///TODO -> map
public virtual float FlowMass { get; set; } /// [kg/h] calculated from conventional true value
public virtual float FlowVolume { get; set; } /// [l/h] calculated from conventional true value
public virtual float VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual float VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual float Time { get; set; } /// [s] Measurement time in seconds
public virtual float ErrorMaster { get; set; } /// [%]
public virtual float PulsesMaster { get; set; }
public virtual float ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
public virtual float TimeDivStart0 { get; set; }
public virtual float TimeDivStart1 { get; set; }
public virtual float TimeDivStart2 { get; set; }
public virtual float TimeDivStart3 { get; set; }
public virtual float TimeDivStart4 { get; set; }
public virtual float TimeDivStart5 { get; set; }
public virtual float TimeDivEnd0 { get; set; }
public virtual float TimeDivEnd1 { get; set; }
public virtual float TimeDivEnd2 { get; set; }
public virtual float TimeDivEnd3 { get; set; }
public virtual float TimeDivEnd4 { get; set; }
public virtual float TimeDivEnd5 { get; set; }
public TestResult()
{
Meters = new List<MeterTestResult>();
CombinedMeters = new List<MeterTestResult>();
}
public TestResult(MetersKind kind)
: this()
{
MetersKind = kind;
if (kind == MetersKind.Single)
{
for (int i = 0; i < Config.Data.WMsCount; i++) Meters.Add(new MeterTestResult(this));
}
else if (kind == MetersKind.Combined)
{
for (int i = 0; i < 2 * Config.Data.CompoundWMsCount; i++) Meters.Add(new MeterTestResult(this));
for (int i = 0; i < Config.Data.CompoundWMsCount; i++) CombinedMeters.Add(new MeterTestResult(this));
}
else if (kind == MetersKind.HeatMeter)
{
/// TODO: Verify if this is OK
for (int i = 0; i < Config.Data.WMsCount; i++) Meters.Add(new MeterTestResult(this));
}
}
public TestResult(Test test, int repetitionNr, MetersKind kind)
: this(kind)
{
if (test.Repeats == 1)
{
Name = test.Name;
}
else
{
Name = string.Format("{0} ({1}/{2})", test.Name, repetitionNr, test.Repeats);
}
RepetitionNr = repetitionNr;
/// Copy test parameters from Entities.Procedure object
ProcedureName = test.Procedure.Name;
ProtocolTitle = test.Procedure.ProtocolTitle;
/// Copy test parameters from Entities.Test object
TestId = test.Id;
TestName = test.Name;
Part = test.Part;
Qfrom = test.Qfrom;
Qto = test.Qto;
Volume = test.Volume;
TstTime = test.TstTime;
Repeats = test.Repeats;
Emptying = test.Emptying;
Zeroing = test.Zeroing;
PumpPower = PumpPower;
Time2MassMsrmt = test.TimeStop2Mass;
Method = test.Method;
ErrLimLo = test.ErrLimLo;
ErrLimHi = test.ErrLimHi;
Uncertainty = test.Uncertainty;
FeedingPath = test.FeedingPath;
BenchPath = test.BenchPath;
OutputPath = test.OutputPath;
MetersPath = test.MetersPath;
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", BatchNr, ProcedureName, TestName, TimeStart.ToShortDateString(), TimeStart.ToShortTimeString());
}
}
}
+3 -2
View File
@@ -8,12 +8,13 @@ namespace Config.Entities
/// <summary>
/// Stores one transition sequence containing a list of transition steps
/// </summary>
public class TransitionSequence : IHasItemNr
public class TransitionSequence : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string OriName { get; set; } /// Not mapped to database
public virtual string Description { get; set; } /// Short description
public virtual IList<TransitionStep> TransitionSteps { get; set; }
public TransitionSequence()
+21 -2
View File
@@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace Config.Entities
{
public class User //: Users.IUser
public class User
{
public virtual int Id { get; protected set; }
public virtual string UserName { get; set; } /// = name, alias, abbreviation
@@ -20,5 +20,24 @@ namespace Config.Entities
{
Groups = new List<Group>();
}
}
/// <summary>
/// Adds a group to the user.
/// </summary>
/// <param name="group">Group to be added</param>
public virtual void AddGroup(Group group)
{
Groups.Add(group);
}
/// <summary>
/// Encrypts and sets users password.
/// </summary>
/// <param name="password">Unencrypted password</param>
public virtual void SetPassword(string password)
{
Password = Users.Entities.User.getHash(password);
LastPwChange = DateTime.Now;
}
}
}
+3 -2
View File
@@ -6,12 +6,13 @@ using System.Collections.Generic;
namespace Config.Entities
{
public class VirtualBenchSequence : IHasItemNr
public class VirtualBenchSequence : IHasName, IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string OriName { get; set; } /// Not mapped to database
public virtual string Description { get; set; } /// Short description
public virtual IList<VirtualBenchStep> VirtualBenchSteps { get; set; }
public VirtualBenchSequence()
+17 -11
View File
@@ -131,9 +131,15 @@ namespace Config
{
using (var transaction = session.BeginTransaction())
{
session.SaveOrUpdate(obj);
try { transaction.Commit(); }
catch { }
try
{
session.SaveOrUpdate(obj);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
}
}
@@ -171,16 +177,16 @@ namespace Config
///
/// Prepare all groups
///
var testers = new Users.Entities.Group((int)Users.Grp.GID.Testers, Strings.Tester);
var testingSpecialists = new Users.Entities.Group((int)Users.Grp.GID.TestingSpecialists, Strings.Testing_Specialist);
var headOfLab = new Users.Entities.Group((int)Users.Grp.GID.HeadOfLab, Strings.Head_of_Lab);
var maintenanceSpecialists = new Users.Entities.Group((int)Users.Grp.GID.MaintenanceSpecialists, Strings.Maintenance_Specialist);
var metrologists = new Users.Entities.Group((int)Users.Grp.GID.Metrologists, Strings.Metrologist);
var calibrationSpecialists = new Users.Entities.Group((int)Users.Grp.GID.CalibrationSpecialists, Strings.Calibration_Specialist);
var administrators = new Users.Entities.Group((int)Users.Grp.GID.Administrators, Strings.Administrator);
var testers = new Config.Entities.Group((int)Users.Grp.GID.Testers, Strings.Tester);
var testingSpecialists = new Config.Entities.Group((int)Users.Grp.GID.TestingSpecialists, Strings.Testing_Specialist);
var headOfLab = new Config.Entities.Group((int)Users.Grp.GID.HeadOfLab, Strings.Head_of_Lab);
var maintenanceSpecialists = new Config.Entities.Group((int)Users.Grp.GID.MaintenanceSpecialists, Strings.Maintenance_Specialist);
var metrologists = new Config.Entities.Group((int)Users.Grp.GID.Metrologists, Strings.Metrologist);
var calibrationSpecialists = new Config.Entities.Group((int)Users.Grp.GID.CalibrationSpecialists, Strings.Calibration_Specialist);
var administrators = new Config.Entities.Group((int)Users.Grp.GID.Administrators, Strings.Administrator);
/// Create the user 'admin' add his groups
var admin = new Users.Entities.User
var admin = new Config.Entities.User
{
UserName = Data.AdminUsername,
FullName = Strings.Administrator,
+2 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -11,6 +11,7 @@ namespace Config.Mappings
public MeasurementCorrectionMap()
{
Id(x => x.Id);
Map(x => x.RangeIx);
Map(x => x.Measurement);
Map(x => x.Correction);
}
-29
View File
@@ -1,29 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class MeterTestResultMap : ClassMap<MeterTestResult>
{
public MeterTestResultMap()
{
Id(x => x.Id);
References(x => x.TestResult);
Map(x => x.Disabled);
Map(x => x.SerialNr);
Map(x => x.EndState);
Map(x => x.VolumeStart);
Map(x => x.VolumeEnd);
Map(x => x.VolumeMeter);
Map(x => x.VolumeRef);
Map(x => x.VolumeErrorPct);
Map(x => x.PulsesMeter);
Map(x => x.PulsesPerLiter);
Map(x => x.PulsesMaster);
Map(x => x.Time);
}
}
}
+2 -1
View File
@@ -21,7 +21,8 @@ namespace Config.Mappings
Map(x => x.StartValve);
Map(x => x.Diverter);
Map(x => x.TempDiv);
Map(x => x.Balance);
Map(x => x.Scale)
.Column("Balance");
Map(x => x.EmptyTankValve);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
+9 -2
View File
@@ -28,12 +28,19 @@ namespace Config.Mappings
Map(x => x.MetersKind);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.DataEntry);
Map(x => x.Protected);
Map(x => x.MustBeComplete);
Map(x => x.ManualCtrlDisabled);
Map(x => x.DataEntry);
Map(x => x.ResultsPrinter);
Map(x => x.ResultsWriter);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
Map(x => x.AltProcName);
Map(x => x.AltProcPeriod);
////Map(x => x.MetrologicalClass);
////HasOne(x => x.WMType);
HasMany(x => x.MoreParams)
+10 -5
View File
@@ -1,6 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Author: Milan Hanajik
/// Copyright (c) 2013-2017 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -16,14 +15,20 @@ namespace Config.Mappings
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Publish);
Map(x => x.Evaluate);
Map(x => x.DoEvaluate)
.Column("Evaluate");
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.DoDraining)
.Column("Emptying");
Map(x => x.DoZeroing)
.Column("Zeroing");
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PumpPower);
Map(x => x.MassRepeats);
Map(x => x.MassSpread);
-109
View File
@@ -1,109 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class TestResultMap : ClassMap<TestResult>
{
public TestResultMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.BatchNr);
Map(x => x.PurchaseOrder);
Map(x => x.MetersKind);
HasMany(x => x.Meters)
.Cascade.All();
HasMany(x => x.CombinedMeters)
.Cascade.All();
Map(x => x.ProcedureName);
Map(x => x.ProtocolTitle);
Map(x => x.TestId);
Map(x => x.TestName);
Map(x => x.Part);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.Time2MassMsrmt);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.Uncertainty);
Map(x => x.FeedingPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.BenchPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.OutputPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.MetersPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.TimeStart);
Map(x => x.TimeEnd);
Map(x => x.RepetitionNr);
Map(x => x.AmbientTempAve);
Map(x => x.AmbientPressAve);
Map(x => x.AmbientHumiAve);
Map(x => x.PressInAvrg);
Map(x => x.PressInStart);
Map(x => x.PressInEnd);
Map(x => x.PressOutAvrg);
Map(x => x.PressOutStart);
Map(x => x.PressOutEnd);
Map(x => x.TempInAvrg);
Map(x => x.TempInStart);
Map(x => x.TempInEnd);
Map(x => x.TempOutAvrg);
Map(x => x.TempOutStart);
Map(x => x.TempOutEnd);
Map(x => x.TempDivAvrg);
Map(x => x.TempDivStart);
Map(x => x.TempDivEnd);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
Map(x => x.MassEndRaw);
Map(x => x.MassEnd);
Map(x => x.MassDiff);
Map(x => x.DensityIn);
Map(x => x.DensityOut);
Map(x => x.DensityDiv);
Map(x => x.FlowMass); /// from conventional true value
Map(x => x.FlowVolume); /// from conventional true value
Map(x => x.VolumeCTV); /// volume conventional true value
Map(x => x.VolumeMaster); /// volume from the master flow meter
Map(x => x.Time); /// measurement time in seconds
Map(x => x.ErrorMaster);
Map(x => x.PulsesMaster);
Map(x => x.ConstMaster); /// Pulses per liter master flow meter
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.TimeDivStart0);
Map(x => x.TimeDivStart1);
Map(x => x.TimeDivStart2);
Map(x => x.TimeDivStart3);
Map(x => x.TimeDivStart4);
Map(x => x.TimeDivStart5);
Map(x => x.TimeDivEnd0);
Map(x => x.TimeDivEnd1);
Map(x => x.TimeDivEnd2);
Map(x => x.TimeDivEnd3);
Map(x => x.TimeDivEnd4);
Map(x => x.TimeDivEnd5);
}
}
}
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("Config")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2016 Sensus Slovensko a.s.")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2018 Sensus Slovensko a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.12.499.0")]
[assembly: AssemblyFileVersion("2.12.499.0")]
[assembly: AssemblyVersion("2.18.797.0")]
[assembly: AssemblyFileVersion("2.18.797.0")]
+153
View File
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Amministratore</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>esperto in calibrazione</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>capo di laboratorio</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>esperto di manutenzione</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>metrologo</value>
</data>
<data name="Tester" xml:space="preserve">
<value>tester</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>esperto di prove </value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>ok</value>
</data>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Impossibile aprire il database\\r\\nCause:\\r\\n{0}</value>
</data>
<data name="Error" xml:space="preserve">
<value>Errore</value>
</data>
</root>
+10 -6
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2017 Sensus Slovensko a.s.
///
using System;
using System.Reflection;
@@ -12,6 +12,7 @@ namespace Config
[Description("---")] None,
[Description("l")] l, /// * 1 liter
[Description("dm3")] dm3, /// 1 dm3 = 1 liter
[Description("m3")] m3, /// 1000 l
[Description("gal(UK)")] gal_UK, /// 1 gal(UK) = 4.54609 l
[Description("gal(US)")] gal_US, /// 1 gal(US) = 3.78541178 l
@@ -29,7 +30,7 @@ namespace Config
[Description("hr")] hour, /// 1 hour = 60 min = 3600 s
[Description("ms")] ms, /// 1 ms = 0.001 s
[Description("°C")] C, /// * degree Celsius
[Description("°C")] C, /// * degree Celsius (°C)
[Description("°F")] F, /// degree Fahrenheit
[Description("K")] K, /// degree Kelvin
@@ -178,6 +179,7 @@ namespace Config
switch (units)
{
case Unit.l:
case Unit.dm3:
case Unit.m3:
case Unit.gal_UK:
case Unit.gal_US:
@@ -269,6 +271,7 @@ namespace Config
switch (units)
{
/// Volume: internal representation in l
case Unit.dm3:
case Unit.l: return v; /// 1 liter
case Unit.m3: return 0.001 * v; /// 1 m3 = 1000 l
case Unit.gal_UK: return 0.21996925 * v; /// 1 gal(UK) = 4.54609 l
@@ -290,8 +293,8 @@ namespace Config
case Unit.hour: return v / 3600;
case Unit.ms: return 1000 * v;
/// Temperature: internal representation in degree C
case Unit.C: return v; /// degree Celsius
/// Temperature: internal representation in °C
case Unit.C: return v; /// degree Celsius (°C)
case Unit.F: return 1.8 * v + 32; /// degree Fahrenheit
case Unit.K: return v + 273.15; /// degree Kelvin
@@ -335,6 +338,7 @@ namespace Config
switch (units)
{
/// Volume: internal representation in l
case Unit.dm3:
case Unit.l: return v; /// 1 liter
case Unit.m3: return 1000 * v; /// 1000 l
case Unit.gal_UK: return 4.54609 * v; /// 1 gal(UK) = 4.54609 l
@@ -356,8 +360,8 @@ namespace Config
case Unit.hour: return 3600 * v;
case Unit.ms: return v / 1000;
/// Temperature: internal representation in degree C
case Unit.C: return v; /// degree Celsius
/// Temperature: internal representation in °C
case Unit.C: return v; /// degree Celsius (°C)
case Unit.F: return 5 * (v-32) / 9; /// degree Fahrenheit
case Unit.K: return v - 273.15; /// degree Kelvin
+1 -1
View File
@@ -92,7 +92,7 @@
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\TestBenchFramework\TBF.csproj">
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project>
<Name>TBF</Name>
</ProjectReference>
+87
View File
@@ -0,0 +1,87 @@
using System;
using System.Drawing;
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
namespace GraphLib
{
public class BackBuffer
{
private Graphics graphics;
private Bitmap memoryBitmap;
private int width;
private int height;
public BackBuffer()
{
width = 0;
height = 0;
}
public bool Init(Graphics g, int width, int height)
{
if (memoryBitmap != null)
{
memoryBitmap.Dispose();
memoryBitmap = null;
}
if (graphics != null)
{
graphics.Dispose();
graphics = null;
}
if (width == 0 || height == 0)
return false;
if ((width != this.width) || (height != this.height) || graphics == null)
{
this.width = width;
this.height = height;
memoryBitmap = new Bitmap(width, height);
graphics = Graphics.FromImage(memoryBitmap);
}
return true;
}
public void Render(Graphics g)
{
if (memoryBitmap != null)
{
g.DrawImage(memoryBitmap,
new Rectangle(0, 0, width, height),
0, 0, width, height,
GraphicsUnit.Pixel);
}
}
public bool CanDoubleBuffer() { return graphics != null; }
public Graphics Graphics { get { return graphics; } }
}
}
+254
View File
@@ -0,0 +1,254 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.ComponentModel;
using System.Drawing;
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
namespace GraphLib
{
public class DataSource
{
public delegate String OnDrawXAxisLabelEvent(DataSource src, int idx);
public delegate String OnDrawYAxisLabelEvent(DataSource src, float value);
public OnDrawXAxisLabelEvent OnRenderXAxisLabel = null;
public OnDrawYAxisLabelEvent OnRenderYAxisLabel = null;
private PointF[] samples = null;
private int length = 0;
private String name = String.Empty;
private int downSample = 1;
private Color color = Color.Black;
public float VisibleDataRange_X = 0;
public float DY = 0;
public float YD0 = -200;
public float YD1 = 200;
public float Cur_YD0 = -200;
public float Cur_YD1 = 200;
public float grid_distance_y = 200; // grid distance in units ( draw a horizontal line every 200 units )
public float off_Y = 0;
public float grid_off_y = 0;
public bool yFlip = true;
public bool Active = true;
public float XAutoScaleOffset = 100;
public float CurGraphHeight = 1.0f;
public float CurGraphWidth = 1.0f;
private bool autoScaleY = false;
private bool autoScaleX = false;
public bool AutoScaleY
{
get { return autoScaleY; }
set { autoScaleY = value; }
}
public bool AutoScaleX
{
get { return autoScaleX; }
set { autoScaleX = value; }
}
public PointF[] Samples
{
get { return samples; }
set
{
samples = value;
length = samples.Length;
}
}
public float XMin
{
get
{
float x_min = float.MaxValue;
if (samples != null && samples.Length > 0)
{
foreach (PointF p in samples) if (p.X < x_min) x_min=p.X;
}
return x_min;
}
}
public float XMax
{
get
{
float x_max = float.MinValue;
if (samples != null && samples.Length > 0)
{
foreach (PointF p in samples) if (p.X > x_max) x_max = p.X;
}
return x_max;
}
}
public float YMin
{
get
{
float y_min = float.MaxValue;
if (samples != null && samples.Length > 0)
{
foreach (PointF p in samples) if (p.Y < y_min) y_min = p.Y;
}
return y_min;
}
}
public float YMax
{
get
{
float y_max = float.MinValue;
if (samples.Length > 0)
{
foreach (PointF p in samples) if (p.Y > y_max) y_max = p.Y;
}
return y_max;
}
}
public void SetDisplayRangeY(float y_start, float y_end)
{
YD0 = y_start;
YD1 = y_end;
}
public void SetGridDistanceY(float grid_dist_y_units)
{
grid_distance_y = grid_dist_y_units;
}
public void SetGridOriginY(float off_y)
{
grid_off_y = off_y;
}
/// <summary>
/// Load Samples from a file. Returns loaded points count.
/// </summary>
/// <param name="pathName">File pathname</param>
/// <returns>Loaded points count</returns>
public int LoadSamples(string pathName, out float yMin, out float yMax)
{
yMin = float.MaxValue;
yMax = float.MinValue;
try
{
Int64 size = new FileInfo(pathName).Length;
if ((size % 8) != 0) return 0;
int samplesCount = (int)(size / 8L) - 1;
if (samplesCount <= 0) return 0;
PointF[] newSamples = new PointF[samplesCount];
using (BinaryReader reader = new BinaryReader(File.Open(pathName, FileMode.Open)))
{
for (int i = 0; i < samplesCount; i++)
{
newSamples[i].X = reader.ReadSingle();
newSamples[i].Y = reader.ReadSingle();
}
yMin = reader.ReadSingle();
yMax = reader.ReadSingle();
}
Samples = newSamples;
return samplesCount;
}
catch (Exception exc)
{
return 0;
}
}
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
[DefaultValue(typeof(string), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public String Name
{
get { return name; }
set { name = value; }
}
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
[DefaultValue(typeof(Color), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Color GraphColor
{
get { return color; }
set { color = value; }
}
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
[DefaultValue(typeof(int), "0")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public int Length
{
get { return length; }
set
{
length = value;
if (length != 0)
{
samples = new PointF[length];
}
else
{
// length is 0
if (samples != null)
{
samples = null;
}
}
}
}
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
[DefaultValue(typeof(int), "1")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public int Downsampling
{
get { return downSample; }
set { downSample = value; }
}
}
}
+116
View File
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ClassLibrary1</RootNamespace>
<AssemblyName>GraphLib</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
</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.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PlotterGraphPaneEx.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PlotterGraphPaneEx.Designer.cs">
<DependentUpon>PlotterGraphPaneEx.cs</DependentUpon>
</Compile>
<Compile Include="PlotterDisplayEx.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PlotterDisplayEx.designer.cs">
<DependentUpon>PlotterDisplayEx.cs</DependentUpon>
</Compile>
<Compile Include="BackBuffer.cs" />
<Compile Include="PlotterGraphSelectCurvesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PlotterGraphSelectCurvesForm.Designer.cs">
<DependentUpon>PlotterGraphSelectCurvesForm.cs</DependentUpon>
</Compile>
<Compile Include="DataSource.cs" />
<Compile Include="PrintPreviewForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PrintPreviewForm.Designer.cs">
<DependentUpon>PrintPreviewForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="PrecisionTimer.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PlotterGraphPaneEx.resx">
<DependentUpon>PlotterGraphPaneEx.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="PlotterDisplayEx.resx">
<DependentUpon>PlotterDisplayEx.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="PlotterGraphSelectCurvesForm.resx">
<SubType>Designer</SubType>
<DependentUpon>PlotterGraphSelectCurvesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PrintPreviewForm.resx">
<SubType>Designer</SubType>
<DependentUpon>PrintPreviewForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<SubType>Designer</SubType>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
+20
View File
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphLib", "GraphLib.csproj", "{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+404
View File
@@ -0,0 +1,404 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.ComponentModel.Design;
using System.Drawing.Drawing2D;
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
namespace GraphLib
{
public partial class PlotterDisplayEx : UserControl
{
#region MEMBERS
delegate void InvokeVoidFuncDelegate();
PlotterGraphSelectCurvesForm GraphPropertiesForm = null;
PrintPreviewForm printPreviewForm = null;
private PrecisionTimer.Timer mTimer = null;
private float play_speed = 0.5f;
private float play_speed_max = 10f;
private float play_speed_min = 0.5f;
private bool paused = false;
private bool isRunning = false;
#endregion
#region CONSTRUCTOR
public PlotterDisplayEx()
{
InitializeComponent();
mTimer = new PrecisionTimer.Timer();
mTimer.Period = 50; // 20 fps
mTimer.Tick += new EventHandler(OnTimerTick);
play_speed = 0.5f; // 20x10 = 200 values per second == sample frequency
mTimer.Start();
isRunning = false;
}
void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
String text = e.ClickedItem.Text;
foreach (DataSource s in gPane.Sources)
{
if (s.Name == text)
{
s.Active ^= true;
gPane.Invalidate();
break;
}
}
}
#endregion
#region PROPERTIES
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(typeof(System.ComponentModel.Design.CollectionEditor),
typeof(System.Drawing.Design.UITypeEditor))]
public IList<DataSource> DataSources
{
get { return gPane.Sources; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(typeof(System.ComponentModel.Design.CollectionEditor),
typeof(System.Drawing.Design.UITypeEditor))]
public PlotterGraphPaneEx.LayoutMode PanelLayout
{
get { return gPane.layout; }
set { gPane.layout = value; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(typeof(System.ComponentModel.Design.CollectionEditor),
typeof(System.Drawing.Design.UITypeEditor))]
public SmoothingMode Smoothing
{
get { return gPane.smoothing; }
set { gPane.smoothing = value; }
}
[Category("Playback")]
[DefaultValue(typeof(bool), "true")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool ShowMovingGrid
{
get { return gPane.hasMovingGrid; }
set { gPane.hasMovingGrid = value; }
}
[Category("Properties")]
[DefaultValue(typeof(Color), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Color BackgroundColorTop
{
get { return gPane.BgndColorTop; }
set { gPane.BgndColorTop = value; }
}
[Category("Properties")]
[DefaultValue(typeof(Color), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Color BackgroundColorBot
{
get { return gPane.BgndColorBot; }
set { gPane.BgndColorBot = value; }
}
[Category("Properties")]
[DefaultValue(typeof(Color), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Color DashedGridColor
{
get { return gPane.MinorGridColor; }
set { gPane.MinorGridColor = value; }
}
[Category("Properties")]
[DefaultValue(typeof(Color), "")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Color SolidGridColor
{
get { return gPane.MajorGridColor; }
set { gPane.MajorGridColor = value; }
}
public bool DoubleBuffering
{
get { return gPane.useDoubleBuffer; }
set { gPane.useDoubleBuffer = value; }
}
#endregion
#region PUBLIC METHODS
public void SetDisplayRangeX(float x_start, float x_end )
{
gPane.XD0 = x_start;
gPane.XD1 = x_end;
gPane.CurXD0 = gPane.XD0;
gPane.CurXD1 = gPane.XD1;
}
public void SetGridDistanceX(float grid_dist_x_samples)
{
gPane.grid_distance_x = grid_dist_x_samples;
}
public void SetGridOriginX(float off_x)
{
gPane.grid_off_x = off_x;
}
#endregion
#region PRIVATE METHODS
protected override void Dispose(bool disposing)
{
paused = true;
if (mTimer.IsRunning)
{
mTimer.Stop();
mTimer.Dispose();
}
base.Dispose(disposing);
}
public void Start()
{
if (isRunning == false && paused == false)
{
gPane.starting_idx = 0;
paused = false;
isRunning = true;
// mTimer.Start();
tb1.Buttons[0].ImageIndex = 2;
}
else
{
if (paused == false)
{
//mTimer.Stop();
paused = true;
}
else
{
// mTimer.Start();
paused = false;
}
if (paused)
{
tb1.Buttons[0].ImageIndex = 0;
}
else
{
tb1.Buttons[0].ImageIndex = 2;
}
}
}
public void Stop()
{
if (isRunning)
{
// mTimer.Stop();
isRunning = false;
paused = false;
hScrollBar1.Value = 0;
tb1.Buttons[0].ImageIndex = 0;
}
}
private void tb1_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
bool pushed = e.Button.Pushed;
switch (e.Button.Tag.ToString().ToLower())
{
case "play":
Start();
break;
case "stop":
Stop();
break;
}
}
private void SetPlayPanelVisible()
{
panel1.Visible = true;
tb1.Buttons[0].Visible = true;
tb1.Buttons[1].Visible = true;
}
private void SetPlayPanelInvisible()
{
panel1.Visible = false;
tb1.Buttons[0].Visible = false;
tb1.Buttons[1].Visible = false;
}
private void UpdateControl()
{
try
{
bool AllAutoscaled = true;
foreach (DataSource s in gPane.Sources)
{
AllAutoscaled &= s.AutoScaleX;
}
if (AllAutoscaled == true)
{
if (panel1.Visible == true)
{
this.Invoke(new MethodInvoker(SetPlayPanelInvisible));
}
}
else
{
if (panel1.Visible == false)
{
this.Invoke(new MethodInvoker(SetPlayPanelVisible));
}
}
}
catch
{
}
}
private void UpdatePlayback()
{
if (!paused && isRunning == true)
{
try
{
gPane.starting_idx += play_speed;
UpdateScrollBar();
gPane.Invalidate();
}
catch { }
}
}
private void OnTimerTick(object sender, EventArgs e)
{
UpdateControl();
UpdatePlayback();
}
private void UpdateScrollBar()
{
if (InvokeRequired)
{
Invoke(new MethodInvoker(UpdateScrollBar));
}
else
{
if (gPane.Sources.Count > 0)
{
if (gPane.starting_idx > gPane.Sources[0].Length)
{
hScrollBar1.Value = 10000;
}
else if (gPane.starting_idx >= 0)
{
hScrollBar1.Value = 10000 * (int)gPane.starting_idx / gPane.Sources[0].Length;
}
else
{
hScrollBar1.Value = 0;
}
}
else
{
hScrollBar1.Value = 0;
}
}
}
private void OnScrollbarScroll(object sender, ScrollEventArgs e)
{
if (gPane.Sources.Count > 0)
{
int val = hScrollBar1.Value;
int maxLen = 0;
foreach (var s in DataSources)
{
if (s.Length > maxLen) maxLen = s.Length;
}
gPane.starting_idx = (int)(maxLen * (float)val / 10000.0f);
gPane.Invalidate();
}
}
#endregion
private void selectGraphsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (GraphPropertiesForm == null)
{
GraphPropertiesForm = new PlotterGraphSelectCurvesForm();
}
GraphPropertiesForm.GraphPanel = this.gPane;
GraphPropertiesForm.Show();
// GraphPropertiesForm.BringToFront();
}
}
}
+201
View File
@@ -0,0 +1,201 @@
namespace GraphLib
{
partial class PlotterDisplayEx
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
#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.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlotterDisplayEx));
this.tb1 = new System.Windows.Forms.ToolBar();
this.tbbSave = new System.Windows.Forms.ToolBarButton();
this.tbbOpen = new System.Windows.Forms.ToolBarButton();
this.imgList1 = new System.Windows.Forms.ImageList(this.components);
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.lb_Position = new System.Windows.Forms.Label();
this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
this.gPane = new GraphLib.PlotterGraphPaneEx();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.selectGraphsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// tb1
//
this.tb1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this.tb1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.tbbSave,
this.tbbOpen});
this.tb1.ButtonSize = new System.Drawing.Size(16, 16);
this.tb1.Divider = false;
this.tb1.Dock = System.Windows.Forms.DockStyle.None;
this.tb1.DropDownArrows = true;
this.tb1.ImageList = this.imgList1;
this.tb1.Location = new System.Drawing.Point(11, 5);
this.tb1.Name = "tb1";
this.tb1.ShowToolTips = true;
this.tb1.Size = new System.Drawing.Size(80, 26);
this.tb1.TabIndex = 1;
this.tb1.Visible = false;
this.tb1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tb1_ButtonClick);
//
// tbbSave
//
this.tbbSave.ImageIndex = 0;
this.tbbSave.Name = "tbbSave";
this.tbbSave.Tag = "play";
//
// tbbOpen
//
this.tbbOpen.ImageIndex = 1;
this.tbbOpen.Name = "tbbOpen";
this.tbbOpen.Tag = "stop";
//
// imgList1
//
this.imgList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList1.ImageStream")));
this.imgList1.TransparentColor = System.Drawing.Color.Transparent;
this.imgList1.Images.SetKeyName(0, "media-playback-start.png");
this.imgList1.Images.SetKeyName(1, "media-playback-stop.png");
this.imgList1.Images.SetKeyName(2, "media-playback-pause.png");
this.imgList1.Images.SetKeyName(3, "printer.png");
//
// splitContainer1
//
this.splitContainer1.BackColor = System.Drawing.SystemColors.Control;
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.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.splitContainer1.Panel1.Controls.Add(this.tb1);
this.splitContainer1.Panel1.Controls.Add(this.panel1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.Transparent;
this.splitContainer1.Panel2.Controls.Add(this.gPane);
this.splitContainer1.Size = new System.Drawing.Size(598, 339);
this.splitContainer1.SplitterDistance = 34;
this.splitContainer1.TabIndex = 2;
this.splitContainer1.TabStop = false;
//
// panel1
//
this.panel1.Controls.Add(this.lb_Position);
this.panel1.Controls.Add(this.hScrollBar1);
this.panel1.Location = new System.Drawing.Point(99, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(496, 28);
this.panel1.TabIndex = 7;
//
// lb_Position
//
this.lb_Position.AutoSize = true;
this.lb_Position.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.lb_Position.Location = new System.Drawing.Point(6, 8);
this.lb_Position.Name = "lb_Position";
this.lb_Position.Size = new System.Drawing.Size(44, 13);
this.lb_Position.TabIndex = 3;
this.lb_Position.Text = "Position";
//
// hScrollBar1
//
this.hScrollBar1.Location = new System.Drawing.Point(57, 10);
this.hScrollBar1.Maximum = 10000;
this.hScrollBar1.Name = "hScrollBar1";
this.hScrollBar1.Size = new System.Drawing.Size(118, 10);
this.hScrollBar1.TabIndex = 4;
this.hScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.OnScrollbarScroll);
//
// gPane
//
this.gPane.Dock = System.Windows.Forms.DockStyle.Fill;
this.gPane.Location = new System.Drawing.Point(0, 0);
this.gPane.Name = "gPane";
this.gPane.Size = new System.Drawing.Size(598, 301);
this.gPane.TabIndex = 1;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.selectGraphsToolStripMenuItem,
this.toolStripSeparator1});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(117, 32);
//
// selectGraphsToolStripMenuItem
//
this.selectGraphsToolStripMenuItem.Name = "selectGraphsToolStripMenuItem";
this.selectGraphsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.selectGraphsToolStripMenuItem.Text = "Options";
this.selectGraphsToolStripMenuItem.Click += new System.EventHandler(this.selectGraphsToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(113, 6);
//
// PlotterDisplayEx
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Transparent;
this.ContextMenuStrip = this.contextMenuStrip1;
this.Controls.Add(this.splitContainer1);
this.Name = "PlotterDisplayEx";
this.Size = new System.Drawing.Size(598, 339);
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.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ToolBar tb1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ToolBarButton tbbSave;
private System.Windows.Forms.ToolBarButton tbbOpen;
private System.Windows.Forms.HScrollBar hScrollBar1;
private PlotterGraphPaneEx gPane;
private System.Windows.Forms.Label lb_Position;
public System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem selectGraphsToolStripMenuItem;
private System.Windows.Forms.ImageList imgList1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.Panel panel1;
}
}
+196
View File
@@ -0,0 +1,196 @@
<?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>
<metadata name="imgList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="imgList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACI
DgAAAk1TRnQBSQFMAgEBBAEAARQBAAEUAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AKgADAQECwAABtgGV
AU8B/QHKAZgBWQH/AcoBlwFZAf8BygGXAVkB/wHKAZcBWQH/AcoBlwFYAf8ByQGXAVgB/wHJAZcBWAH/
AcoBmAFZAf8BtgGUAU8B/RQAAxQBHAMRARcDAgEDrAADTgGZA10B0gNMAf8BxwGVAVUB/wH5AfcB9gH/
AfkB8QHsAf8B+QHxAesB/wH4AfAB6QH/AfcB7QHmAf8B9AHqAeEB/wHyAegB3gH/AfoB+AH2Af8BxwGU
AVUB/wMYAf8DWAHRA0QBeggAAxUBHQFiAlgB6QM6AWEDDQESAwABASwAAxsBJgMbASYDGwEmAxsBJgMb
ASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmEAADGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEm
AxsBJgMbASYDGwEmAxsBJgMbASYIAANUAf0DpwH/A7UB/wOBAf8BrwGsAaoB/wHFAcABvQH/AcUBwAG9
Af8BxQHAAb0B/wHFAcABvQH/AcUBwAG9Af8BxQHAAb0B/wGtAaoBqAH/AyAB/wO1Af8DmwH/AxcB/wgA
AxUBHQNNAfoBOgIrAfwDXwHgAysBQgMNARIoAAMbASYDKwH8AYACgQH/AYACgQH/AYACgQH/AYACgQH/
AYACgQH/AYACgQH/AYACgQH/AYACgQH/AYACgQH/AxsBJhAAAxsBJgMrAfwBgAKBAf8BgAKBAf8BgAKB
Af8DIwE0AxsBJgMrAfwBgAKBAf8BgAKBAf8BgAKBAf8DIwE0CAADZAH/A7UB/wO1Af8DlQH/A4EB/wOB
Af8DbQH/A2IB/wNVAf8DRgH/AzcB/wM2Af8DYgH/A7UB/wO1Af8DGQH/CAADFQEdAV8CSgH7AfkB+gH5
Af8DfwH+AV8BUwFSAfsDVQGyAx0BKgMIAQsgAAMbASYDQAH9IP8DQAH9AxsBJgMAAQEMAAMbASYDQAH9
AfwB/QH8Bf8DQAH9AxsBJgMbASYDQAH9AfwB/QH8Bf8DQAH9AxsBJgMAAQEEAANpAf8DuwH/A7sB/wON
Af8D1AH/A7kB/wO5Af8DuQH/A7kB/wO5Af8DuQH/A9MB/wODAf8DuwH/A7sB/wMeAf8IAAMVAR0DKwH8
AfoC+wH/AfUC9gH/AfkC+gH/ATsBLgEtAfwBbQJRAfcDQgF2AxYBHgMFAQcYAAMbASYDQAH9BP8B1QHb
AdgB/wHUAdsB1wH/AdQB2wHYAf8B0wHbAdcB/wHRAdkB1QH/Ac8B1wHTBf8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9AeIB5QHkAf8B2AHfAdwB/wNAAf0DGwEmAxsBJgNAAf0D8wH/AfcB+AH3Af8DQAH9AxsBJgMB
AQIEAANuAf8D1wH/A9cB/wOXAf8D2AH/A78B/wO/Af8DvwH/A78B/wO/Af8DvwH/A9cB/wOOAf8D1wH/
A9cB/wMzAf8IAAMWAR4DKwH8A/sB/wHTAdoB1wH/AdoB3wHcAf8B9gH3AfYB/wHyAvMB/wE6AisB/AFg
AlkB6wMzAVMDEgEZAwQBBRAAAxsBJgNAAf0E/wHaAeAB3QH/AdsB4QHeAf8B3QHiAeAB/wHdAeIB4AH/
AdsB4QHeAf8B2AHeAdsF/wNAAf0DGwEmAwEBAgwAAxsBJgNAAf0B4gHmAeQB/wHcAeIB3wH/A0AB/QMb
ASYDGwEmA0AB/QHvAfEB8AH/AfAB8wHxAf8DQAH9AxsBJgMBAQIEAANyAf8D+QH/A/kB/wOrAf8D3wH/
A8sB/wPLAf8DywH/A8sB/wPLAf8DywH/A98B/wOjAf8D+QH/A/kB/wNVAf8IAAMWAR4DKwH8A/sB/wHf
AeQB4QH/Ad4B4wHhAf8B3gHjAeAB/wHjAecB5QH/AfQC9QH/A38B/gGRAkAB/QNWAbYDJgE5AxABFQwA
AxsBJgNAAf0E/wHdAeMB4AH/AeEB5gHjAf8B5AHpAecB/wHmAeoB6AH/AeUB6QHnAf8B4gHnAeQF/wNA
Af0DGwEmAwEBAgwAAxsBJgNAAf0B5AHoAeUB/wHeAeMB4QH/A0AB/QMbASYDGwEmA0AB/QHsAe8B7gH/
AecB6wHpAf8DQAH9AxsBJgMBAQIEAANqAfkD/AH/A/wB/wPLAf8D8gH/A/IB/wPyAf8D8gH/A/IB/wPy
Af8D8gH/A/IB/wPGAf8D/AH/A/wB/wNwAf4IAAMWAR4DKwH8A/sB/wHqAe4B7AH/AewB7wHuAf8B7AHv
Ae4B/wHrAe4B7QH/AekB7AHrAf8DfwH+AToCKwH8AVgCVgG7Ax0BKgMGAQgMAAMbASYDQAH9BP8B3wHk
AeEB/wHkAekB5gH/AeoB7QHrAf8B7gHxAe8B/wHvAfEB8AH/AewB7wHuBf8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9AesB7QHsAf8B3QHjAeAB/wNAAf0DGwEmAxsBJgNAAf0B7QHwAe8B/wHfAeQB4QH/A0AB/QMb
ASYDAQECBAADXQTSAf8D6AH/A3EB/wNxAf8DcQH/A3EB/wNxAf8DcQH/A3EB/wNxAf8DcQH/A3EB/wPo
Af8DxAH/A1wB3AgAAxYBHgMrAfwD+wH/AfUC9gH/AfoB+wH6Af8D+QH/Ad0C3gH/AWoCRwH5A10B7QE6
AjkBYAMNAREUAAMbASYDQAH9BP8B3AHiAd8B/wHkAegB5gH/AesB7gHtAf8B8gH0AfMB/wH3AvgB/wH2
AfgB9wX/A0AB/QMbASYDAQECDAADGwEmA0AB/QHyAfQB8wH/AdoB3wHdAf8DQAH9AxsBJgMcASgDQAH9
AfMB9QH0Af8B1gHdAdkB/wNAAf0DGwEmAwEBAgQAAy0BRQOaAf8DzAH/AccBiwFCAf8B+QH0Ae0B/wH+
AegB2AH/Af4B6AHXAf8B/QHlAdMB/wH8AeQB0QH/AfoB4AHHAf8B+QHdAcMB/wH6AfQB7QH/AccBhQE+
Af8DwwH/A2gB/wMtAUUIAAMWAR4DKwH8A/sB/wHwAfMB8gH/AeYC6AH/A00B+gFiAlIB9AFRAk8BpQMU
ARwDAAEBGAADGwEmA0AB/QT/AdgB3wHcAf8B4AHlAeMB/wHoAesB6gH/Ae8B8gHwAf8B9wH4AfcB/wP9
Bf8DQAH9AxsBJgMBAQIMAAMbASYDQAH9A/wB/wHVAdsB2AH/A0AB/QMbASYDHAEoA0AB/QP8Af8B0gHa
AdYB/wNAAf0DGwEmAwEBAggAAzsBYwNqAfMBxQGJAUAB/wH5AfQB7wH/Af4B5wHXAf8B/QHnAdUB/wH8
AeYB0gH/AfsB4QHMAf8B+AHcAcIB/wH2AdoBvQH/AfoB9AHvAf8BxAGDATwB/wNdAfMDOwFjDAADFgEe
AysB/AP7Af8BPgIyAfwDTQH6AVoCVwG9AxgBIgMCAQMgAAMbASYDQAH9IP8DQAH9AxsBJgMBAQIMAAMb
ASYDQAH9CP8DQAH9AxsBJgMcASgDQAH9CP8DQAH9AxsBJgMBAQIMAAMHAQkBlgF6AUcC+QH0AfAB/wH8
AeYB0wH/Af0B5wHTAf8B+wHjAc0B/wH6AeAByAH/AfUB1gG7Af8B8wHUAbUB/wH4AfQB8AH/AZUBagFH
AfkDBwEJEAADFgEeA0AB/QFbAjIB+wFgAlwB1AMjATMDBwEKKAADGwEmAysB/AEpAS0BKwH/ASkBLQEr
Af8BKQEtASsB/wEpAS0BKwH/ASkBLQErAf8BKQEtASsB/wEpAS0BKwH/ASkBLQErAf8BKQEtASsB/wMb
ASYDAQECDAADGwEmAWMBVwFVAf4BKQEtASsB/wEpAS0BKwH/ASkBLQErAf8DGwEmAxwBKAFjAVcBVQH+
ASkBLQErAf8BKQEtASsB/wEpAS0BKwH/AxsBJgMBAQIQAAGSAXoBUQH3AfkB9QHxAf8B/AHjAc8B/wH8
AeQBzwH/AfoB4QHKAf8B+QHdAcQB/wH0AekB3wH/AfcB8gHsAf8B9QHvAekB/wGZAV8BRQH7FAADFgEf
AV4CWgHYAygBPQMNAREwAAMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEm
AxsBJgMAAQEMAAMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMA
AQEQAAGJAWoBSQH2AfkB9QHxAf8B/AHjAc0B/wH7AeMBzQH/AfkB4AHIAf8B+AHcAcIB/wH9AfsB+AH/
AfwB5gHNAf8B4gG2AYQB/wJUAVIBphQAAxYBHwMRARcDAgEDuAABngF1AU0B+gH3AfIB7AH/AfgB9AHu
Af8B+AHzAe0B/wH4AfMB7QH/AfgB8gHsAf8B8gHmAdcB/wHiAbIBcQH/AZABcQFiAfYDBQEHFAADAwEE
wAADOgFgAlgBVgG7AbEBfwFPAf4ByAGMAUMB/wGSAX8BUQH3AZIBfwFRAfcBrgF/AUwB/gNOAZQUAAFC
AU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYAAQEWAAP/gQAB3wX/AeABBwHHBf8CAAHBAf8BwAED
AcABAwIAAcAB/wHAAQMBwAEDAgABwAE/AcABAQHAAQECAAHAAQ8BwAEBAcABAQIAAcABAwHAAQEBwAEB
AgABwAEBAcABAQHAAQECAAHAAQEBwAEBAcABAQIAAcABBwHAAQEBwAEBAgABwAEPAcABAQHAAQEBgAEB
AcABPwHAAQEBwAEBAcABAwHAAf8BwAEBAcABAQHgAQcBwwH/AcABAQHAAQEB4AEHAccF/wHgAQcB3wX/
AeABHws=
</value>
</data>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>84, 17</value>
</metadata>
</root>
+46
View File
@@ -0,0 +1,46 @@
namespace GraphLib
{
partial class PlotterGraphPaneEx
{
/// <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.SuspendLayout();
//
// PlotterGraphPane
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "PlotterGraphPane";
this.Size = new System.Drawing.Size(409, 150);
this.Load += new System.EventHandler(this.OnLoadControl);
this.ResumeLayout(false);
}
#endregion
}
}
File diff suppressed because it is too large Load Diff
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+365
View File
@@ -0,0 +1,365 @@
namespace GraphLib
{
partial class PlotterGraphSelectCurvesForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lb_Graphs = new System.Windows.Forms.CheckedListBox();
this.gB_SelectedGraph = new System.Windows.Forms.GroupBox();
this.cb_X_AutoScale = new System.Windows.Forms.CheckBox();
this.tb_GraphName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.cbDownSampling = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.btn_GraphColor = new System.Windows.Forms.Button();
this.cb_Y_AutoScale = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.bt_MinorGridColor = new System.Windows.Forms.Button();
this.bt_bg_col_bot = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.bt_MajorGridColor = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.bt_bg_col_top = new System.Windows.Forms.Button();
this.btn_AutoScaleAll = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.cb_Layout = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.gB_SelectedGraph.SuspendLayout();
this.groupBox1.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";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lb_Graphs);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.gB_SelectedGraph);
this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
this.splitContainer1.Panel2.Controls.Add(this.button1);
this.splitContainer1.Size = new System.Drawing.Size(395, 431);
this.splitContainer1.SplitterDistance = 171;
this.splitContainer1.TabIndex = 0;
//
// lb_Graphs
//
this.lb_Graphs.Dock = System.Windows.Forms.DockStyle.Fill;
this.lb_Graphs.FormattingEnabled = true;
this.lb_Graphs.Location = new System.Drawing.Point(0, 0);
this.lb_Graphs.Name = "lb_Graphs";
this.lb_Graphs.Size = new System.Drawing.Size(171, 424);
this.lb_Graphs.TabIndex = 0;
this.lb_Graphs.SelectedIndexChanged += new System.EventHandler(this.checkedListBox1_SelectedIndexChanged_1);
//
// gB_SelectedGraph
//
this.gB_SelectedGraph.Controls.Add(this.cb_X_AutoScale);
this.gB_SelectedGraph.Controls.Add(this.tb_GraphName);
this.gB_SelectedGraph.Controls.Add(this.label3);
this.gB_SelectedGraph.Controls.Add(this.cbDownSampling);
this.gB_SelectedGraph.Controls.Add(this.label2);
this.gB_SelectedGraph.Controls.Add(this.btn_GraphColor);
this.gB_SelectedGraph.Controls.Add(this.cb_Y_AutoScale);
this.gB_SelectedGraph.Location = new System.Drawing.Point(6, 232);
this.gB_SelectedGraph.Name = "gB_SelectedGraph";
this.gB_SelectedGraph.Size = new System.Drawing.Size(206, 158);
this.gB_SelectedGraph.TabIndex = 6;
this.gB_SelectedGraph.TabStop = false;
this.gB_SelectedGraph.Text = "Selected Graph Options";
this.gB_SelectedGraph.Visible = false;
//
// cb_X_AutoScale
//
this.cb_X_AutoScale.AutoSize = true;
this.cb_X_AutoScale.Location = new System.Drawing.Point(12, 102);
this.cb_X_AutoScale.Name = "cb_X_AutoScale";
this.cb_X_AutoScale.Size = new System.Drawing.Size(93, 17);
this.cb_X_AutoScale.TabIndex = 8;
this.cb_X_AutoScale.Text = "X AutoScaling";
this.cb_X_AutoScale.UseVisualStyleBackColor = true;
this.cb_X_AutoScale.CheckedChanged += new System.EventHandler(this.cb_X_AutoScale_CheckedChanged);
//
// tb_GraphName
//
this.tb_GraphName.Location = new System.Drawing.Point(12, 24);
this.tb_GraphName.Name = "tb_GraphName";
this.tb_GraphName.Size = new System.Drawing.Size(167, 20);
this.tb_GraphName.TabIndex = 7;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(52, 133);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(76, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Downsampling";
//
// cbDownSampling
//
this.cbDownSampling.FormattingEnabled = true;
this.cbDownSampling.Items.AddRange(new object[] {
"1",
"2",
"3",
"4",
"5",
"6"});
this.cbDownSampling.Location = new System.Drawing.Point(7, 130);
this.cbDownSampling.Name = "cbDownSampling";
this.cbDownSampling.Size = new System.Drawing.Size(39, 21);
this.cbDownSampling.TabIndex = 5;
this.cbDownSampling.Text = "1";
this.cbDownSampling.SelectedIndexChanged += new System.EventHandler(this.OnDownsamplingChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(57, 55);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(63, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Graph Color";
//
// btn_GraphColor
//
this.btn_GraphColor.Location = new System.Drawing.Point(11, 50);
this.btn_GraphColor.Name = "btn_GraphColor";
this.btn_GraphColor.Size = new System.Drawing.Size(26, 23);
this.btn_GraphColor.TabIndex = 3;
this.btn_GraphColor.UseVisualStyleBackColor = true;
this.btn_GraphColor.Click += new System.EventHandler(this.btn_GraphColor_Click);
//
// cb_Y_AutoScale
//
this.cb_Y_AutoScale.AutoSize = true;
this.cb_Y_AutoScale.Location = new System.Drawing.Point(12, 79);
this.cb_Y_AutoScale.Name = "cb_Y_AutoScale";
this.cb_Y_AutoScale.Size = new System.Drawing.Size(93, 17);
this.cb_Y_AutoScale.TabIndex = 2;
this.cb_Y_AutoScale.Text = "Y AutoScaling";
this.cb_Y_AutoScale.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.bt_MinorGridColor);
this.groupBox1.Controls.Add(this.bt_bg_col_bot);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.bt_MajorGridColor);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.bt_bg_col_top);
this.groupBox1.Controls.Add(this.btn_AutoScaleAll);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.cb_Layout);
this.groupBox1.Location = new System.Drawing.Point(6, 5);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(206, 221);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "General Options";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(57, 194);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(82, 13);
this.label7.TabIndex = 10;
this.label7.Text = "Minor Grid Color";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(57, 136);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(128, 13);
this.label5.TabIndex = 8;
this.label5.Text = "Background Color Bottom";
//
// bt_MinorGridColor
//
this.bt_MinorGridColor.Location = new System.Drawing.Point(11, 189);
this.bt_MinorGridColor.Name = "bt_MinorGridColor";
this.bt_MinorGridColor.Size = new System.Drawing.Size(26, 23);
this.bt_MinorGridColor.TabIndex = 9;
this.bt_MinorGridColor.UseVisualStyleBackColor = true;
this.bt_MinorGridColor.Click += new System.EventHandler(this.bt_MinorGridColor_Click);
//
// bt_bg_col_bot
//
this.bt_bg_col_bot.Location = new System.Drawing.Point(11, 131);
this.bt_bg_col_bot.Name = "bt_bg_col_bot";
this.bt_bg_col_bot.Size = new System.Drawing.Size(26, 23);
this.bt_bg_col_bot.TabIndex = 7;
this.bt_bg_col_bot.UseVisualStyleBackColor = true;
this.bt_bg_col_bot.Click += new System.EventHandler(this.bt_bg_col_bot_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(57, 165);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(82, 13);
this.label6.TabIndex = 8;
this.label6.Text = "Major Grid Color";
//
// bt_MajorGridColor
//
this.bt_MajorGridColor.Location = new System.Drawing.Point(11, 160);
this.bt_MajorGridColor.Name = "bt_MajorGridColor";
this.bt_MajorGridColor.Size = new System.Drawing.Size(26, 23);
this.bt_MajorGridColor.TabIndex = 7;
this.bt_MajorGridColor.UseVisualStyleBackColor = true;
this.bt_MajorGridColor.Click += new System.EventHandler(this.bt_MajorGridColor_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(57, 107);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(114, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Background Color Top";
//
// bt_bg_col_top
//
this.bt_bg_col_top.Location = new System.Drawing.Point(11, 102);
this.bt_bg_col_top.Name = "bt_bg_col_top";
this.bt_bg_col_top.Size = new System.Drawing.Size(26, 23);
this.bt_bg_col_top.TabIndex = 5;
this.bt_bg_col_top.UseVisualStyleBackColor = true;
this.bt_bg_col_top.Click += new System.EventHandler(this.bt_bg_col_top_Click);
//
// btn_AutoScaleAll
//
this.btn_AutoScaleAll.Location = new System.Drawing.Point(11, 69);
this.btn_AutoScaleAll.Name = "btn_AutoScaleAll";
this.btn_AutoScaleAll.Size = new System.Drawing.Size(167, 25);
this.btn_AutoScaleAll.TabIndex = 4;
this.btn_AutoScaleAll.Text = "Auto Scale All";
this.btn_AutoScaleAll.UseVisualStyleBackColor = true;
this.btn_AutoScaleAll.Click += new System.EventHandler(this.OnButtonAutoScallOnClicked);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 26);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(39, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Layout";
//
// cb_Layout
//
this.cb_Layout.FormattingEnabled = true;
this.cb_Layout.Items.AddRange(new object[] {
"Normal",
"Stacked",
"Tiles - Fill Vertical",
"Tiles - Fill Horizontal",
"Vertically"});
this.cb_Layout.Location = new System.Drawing.Point(11, 42);
this.cb_Layout.Name = "cb_Layout";
this.cb_Layout.Size = new System.Drawing.Size(168, 21);
this.cb_Layout.TabIndex = 2;
this.cb_Layout.Text = "Select";
this.cb_Layout.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// button1
//
this.button1.Location = new System.Drawing.Point(66, 396);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(68, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Exit";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// PlotterGraphSelectCurvesForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(395, 431);
this.Controls.Add(this.splitContainer1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(16, 246);
this.Name = "PlotterGraphSelectCurvesForm";
this.Text = "Graph Properties";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.gB_SelectedGraph.ResumeLayout(false);
this.gB_SelectedGraph.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckedListBox lb_Graphs;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cb_Layout;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btn_GraphColor;
private System.Windows.Forms.CheckBox cb_Y_AutoScale;
private System.Windows.Forms.Button btn_AutoScaleAll;
private System.Windows.Forms.GroupBox gB_SelectedGraph;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cbDownSampling;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button bt_bg_col_top;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button bt_bg_col_bot;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button bt_MinorGridColor;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button bt_MajorGridColor;
private System.Windows.Forms.TextBox tb_GraphName;
private System.Windows.Forms.CheckBox cb_X_AutoScale;
}
}
+369
View File
@@ -0,0 +1,369 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
namespace GraphLib
{
public partial class PlotterGraphSelectCurvesForm : Form
{
private int selectetGraphIndex = -1;
private PlotterGraphPaneEx gpane = null;
public PlotterGraphSelectCurvesForm()
{
InitializeComponent();
FormClosing += new FormClosingEventHandler(OnFormClosing);
lb_Graphs.SelectedIndexChanged += new EventHandler(OnSelectedGraphIndexChanged);
VisibleChanged += new EventHandler(OnVisibleChanged);
tb_GraphName.TextChanged += new EventHandler(tb_GraphName_TextChanged);
}
void tb_GraphName_TextChanged(object sender, EventArgs e)
{
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
{
DataSource src = gpane.Sources[selectetGraphIndex];
String Text = tb_GraphName.Text;
if (String.IsNullOrEmpty(Text) == false)
{
src.Name = Text;
gpane.Invalidate();
}
}
}
public PlotterGraphPaneEx GraphPanel
{
set
{
gpane = value;
if (gpane != null)
{
this.lb_Graphs.Items.Clear();
foreach (DataSource s in gpane.Sources)
{
if (s.Active)
{
this.lb_Graphs.Items.Add(s.Name, CheckState.Checked);
}
else
{
this.lb_Graphs.Items.Add(s.Name, CheckState.Unchecked);
}
}
UpdateAllCheckedState();
}
}
}
void UpdateAllCheckedState()
{
int AutoScaleOn = 0;
foreach (DataSource src in gpane.Sources)
{
if (src.AutoScaleY)
{
AutoScaleOn++;
}
}
if (AutoScaleOn == 0)
{
btn_AutoScaleAll.Visible = true;
btn_AutoScaleAll.Text = "Auto Y-Scale all Graphs";
}
else
{
btn_AutoScaleAll.Visible = true;
btn_AutoScaleAll.Text = "Normal Y-Scale all Graphs";
}
}
void OnVisibleChanged(object sender, EventArgs e)
{
if (this.Visible == true)
{
selectetGraphIndex = -1;
gB_SelectedGraph.Visible = false;
if (gpane != null)
{
UpdateAllCheckedState();
if (gpane.layout == PlotterGraphPaneEx.LayoutMode.NORMAL)
{
cb_Layout.SelectedIndex = 0;
}
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.STACKED)
{
cb_Layout.SelectedIndex = 1;
}
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.TILES_HOR)
{
cb_Layout.SelectedIndex = 2;
}
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.TILES_VER)
{
cb_Layout.SelectedIndex = 3;
}
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.VERTICAL_ARRANGED)
{
cb_Layout.SelectedIndex = 4;
}
bt_bg_col_top.BackColor = gpane.BgndColorTop;
bt_bg_col_bot.BackColor = gpane.BgndColorBot;
bt_MajorGridColor.BackColor = gpane.MajorGridColor;
bt_MinorGridColor.BackColor = gpane.MinorGridColor;
}
}
}
void OnSelectedGraphIndexChanged(object sender, EventArgs e)
{
if (gpane != null)
{
for (int i = 0; i < gpane.Sources.Count; i++)
{
if (lb_Graphs.CheckedIndices.Contains(i))
{
gpane.Sources[i].Active = true;
}
else
{
gpane.Sources[i].Active = false;
}
}
gpane.Invalidate();
}
}
void OnFormClosing(object sender, FormClosingEventArgs e)
{
this.Hide();
e.Cancel = true;
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (cb_Layout.SelectedIndex == 0)
{
gpane.layout = PlotterGraphPaneEx.LayoutMode.NORMAL;
}
if (cb_Layout.SelectedIndex == 1)
{
gpane.layout = PlotterGraphPaneEx.LayoutMode.STACKED;
}
if (cb_Layout.SelectedIndex == 2)
{
gpane.layout = PlotterGraphPaneEx.LayoutMode.TILES_VER;
}
if (cb_Layout.SelectedIndex == 3)
{
gpane.layout = PlotterGraphPaneEx.LayoutMode.TILES_HOR;
}
if (cb_Layout.SelectedIndex == 4)
{
gpane.layout = PlotterGraphPaneEx.LayoutMode.VERTICAL_ARRANGED;
}
gpane.Invalidate();
}
private void checkedListBox1_SelectedIndexChanged_1(object sender, EventArgs e)
{
selectetGraphIndex = lb_Graphs.SelectedIndex;
UpdateSelectedGraphInfo();
gB_SelectedGraph.Visible = true;
}
private void UpdateSelectedGraphInfo()
{
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
{
DataSource src = gpane.Sources[selectetGraphIndex];
btn_GraphColor.BackColor = src.GraphColor;
cb_Y_AutoScale.Checked = src.AutoScaleY;
cb_X_AutoScale.Checked = src.AutoScaleX;
cbDownSampling.SelectedIndex = (src.Downsampling - 1);
tb_GraphName.Text = src.Name;
}
}
private void btn_GraphColor_Click(object sender, EventArgs e)
{
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
{
DataSource src = gpane.Sources[selectetGraphIndex];
ColorDialog d = new ColorDialog();
if (d.ShowDialog() == DialogResult.OK)
{
btn_GraphColor.BackColor = d.Color;
src.GraphColor = d.Color;
gpane.Invalidate();
}
}
}
private void OnButtonAutoScallOnClicked(object sender, EventArgs e)
{
int AutoScaleOn = 0;
foreach (DataSource src in gpane.Sources)
{
if (src.AutoScaleY)
{
AutoScaleOn++;
}
}
if (AutoScaleOn == 0)
{
btn_AutoScaleAll.Text = "Normal scale for all graphs";
foreach (DataSource src in gpane.Sources)
{
src.AutoScaleY = true;
}
}
else
{
btn_AutoScaleAll.Text = "Auto scale for all graphs";
foreach (DataSource src in gpane.Sources)
{
src.AutoScaleY = false;
}
}
UpdateSelectedGraphInfo();
gpane.Invalidate();
}
private void OnDownsamplingChanged(object sender, EventArgs e)
{
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
{
DataSource src = gpane.Sources[selectetGraphIndex];
src.Downsampling = (cbDownSampling.SelectedIndex + 1);
}
gpane.Invalidate();
}
private void bt_bg_col_top_Click(object sender, EventArgs e)
{
ColorDialog d = new ColorDialog();
if (d.ShowDialog() == DialogResult.OK)
{
bt_bg_col_top.BackColor = d.Color;
gpane.BgndColorTop = d.Color;
gpane.Invalidate();
}
}
private void bt_bg_col_bot_Click(object sender, EventArgs e)
{
ColorDialog d = new ColorDialog();
if (d.ShowDialog() == DialogResult.OK)
{
bt_bg_col_bot.BackColor = d.Color;
gpane.BgndColorBot = d.Color;
gpane.Invalidate();
}
}
private void bt_MajorGridColor_Click(object sender, EventArgs e)
{
ColorDialog d = new ColorDialog();
if (d.ShowDialog() == DialogResult.OK)
{
bt_MajorGridColor.BackColor = d.Color;
gpane.MajorGridColor = d.Color;
gpane.Invalidate();
}
}
private void bt_MinorGridColor_Click(object sender, EventArgs e)
{
ColorDialog d = new ColorDialog();
if (d.ShowDialog() == DialogResult.OK)
{
bt_MinorGridColor.BackColor = d.Color;
gpane.MinorGridColor = d.Color;
gpane.Invalidate();
}
}
private void cb_Y_AutoScale_CheckedChanged(object sender, EventArgs e)
{
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
{
DataSource src = gpane.Sources[selectetGraphIndex];
src.AutoScaleY = cb_Y_AutoScale.Checked;
UpdateAllCheckedState();
gpane.Invalidate();
}
}
private void cb_X_AutoScale_CheckedChanged(object sender, EventArgs e)
{
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
{
DataSource src = gpane.Sources[selectetGraphIndex];
src.AutoScaleX = cb_X_AutoScale.Checked;
UpdateAllCheckedState();
gpane.Invalidate();
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+490
View File
@@ -0,0 +1,490 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
#region License
/*
* Based on the work of Leslie Sanford
*/
#endregion
namespace PrecisionTimer
{
public enum Mode
{
OneShot,
Periodic
};
[StructLayout(LayoutKind.Sequential)]
public struct TimerCaps
{
public int periodMin;
public int periodMax;
}
public sealed class Timer : IComponent
{
private delegate void TimeProc(int id, int msg, int user, int param1, int param2);
private delegate void EventRaiser(EventArgs e);
[DllImport("winmm.dll")]
private static extern int timeGetDevCaps(ref TimerCaps caps,
int sizeOfTimerCaps);
[DllImport("winmm.dll")]
private static extern int timeSetEvent(int delay,
int resolution,
TimeProc proc,
int user,
int mode);
[DllImport("winmm.dll")]
private static extern int timeKillEvent(int id);
private const int TIMERR_NOERROR = 0;
private int timerID;
private volatile Mode mode;
private volatile int period;
private volatile int resolution;
private TimeProc timeProcPeriodic;
private TimeProc timeProcOneShot;
private EventRaiser tickRaiser;
private bool running = false;
private volatile bool disposed = false;
private ISynchronizeInvoke synchronizingObject = null;
private ISite site = null;
private static TimerCaps caps;
public event EventHandler Started;
public event EventHandler Stopped;
public event EventHandler Tick;
static Timer()
{
// Get multimedia timer capabilities.
timeGetDevCaps(ref caps, Marshal.SizeOf(caps));
}
public Timer(IContainer container)
{
container.Add(this);
Initialize();
}
public Timer()
{
Initialize();
}
~Timer()
{
if(IsRunning)
{
// Stop and destroy timer.
timeKillEvent(timerID);
}
}
private void Initialize()
{
this.mode = Mode.Periodic;
this.period = Capabilities.periodMin;
this.resolution = 1;
running = false;
timeProcPeriodic = new TimeProc(TimerPeriodicEventCallback);
timeProcOneShot = new TimeProc(TimerOneShotEventCallback);
tickRaiser = new EventRaiser(OnTick);
}
public void Start()
{
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
if(IsRunning)
{
return;
}
if(Mode == Mode.Periodic)
{
timerID = timeSetEvent(Period, Resolution, timeProcPeriodic, 0, (int)Mode);
}
else
{
timerID = timeSetEvent(Period, Resolution, timeProcOneShot, 0, (int)Mode);
}
if(timerID != 0)
{
running = true;
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
{
SynchronizingObject.BeginInvoke(
new EventRaiser(OnStarted),
new object[] { EventArgs.Empty });
}
else
{
OnStarted(EventArgs.Empty);
}
}
else
{
throw new TimerException("Unable to start timer.");
}
}
public void Stop()
{
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
if(!running)
{
return;
}
int result = timeKillEvent(timerID);
Debug.Assert(result == TIMERR_NOERROR);
running = false;
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
{
SynchronizingObject.BeginInvoke(
new EventRaiser(OnStopped),
new object[] { EventArgs.Empty });
}
else
{
OnStopped(EventArgs.Empty);
}
}
private void TimerPeriodicEventCallback(int id, int msg, int user, int param1, int param2)
{
if(synchronizingObject != null)
{
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
}
else
{
OnTick(EventArgs.Empty);
}
}
private void TimerOneShotEventCallback(int id, int msg, int user, int param1, int param2)
{
if(synchronizingObject != null)
{
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
Stop();
}
else
{
OnTick(EventArgs.Empty);
Stop();
}
}
// Raises the Disposed event.
private void OnDisposed(EventArgs e)
{
EventHandler handler = Disposed;
if(handler != null)
{
handler(this, e);
}
}
// Raises the Started event.
private void OnStarted(EventArgs e)
{
EventHandler handler = Started;
if(handler != null)
{
handler(this, e);
}
}
// Raises the Stopped event.
private void OnStopped(EventArgs e)
{
EventHandler handler = Stopped;
if(handler != null)
{
handler(this, e);
}
}
// Raises the Tick event.
private void OnTick(EventArgs e)
{
EventHandler handler = Tick;
if(handler != null)
{
handler(this, e);
}
}
/// <summary>
/// Gets or sets the object used to marshal event-handler calls.
/// </summary>
public ISynchronizeInvoke SynchronizingObject
{
get
{
#region Require
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
#endregion
return synchronizingObject;
}
set
{
#region Require
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
#endregion
synchronizingObject = value;
}
}
public int Period
{
get
{
#region Require
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
#endregion
return period;
}
set
{
#region Require
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
else if(value < Capabilities.periodMin || value > Capabilities.periodMax)
{
throw new ArgumentOutOfRangeException("Period", value,
"Multimedia Timer period out of range.");
}
#endregion
period = value;
if(IsRunning)
{
Stop();
Start();
}
}
}
public int Resolution
{
get
{
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
return resolution;
}
set
{
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
else if(value < 0)
{
throw new ArgumentOutOfRangeException("Resolution", value,
"timer resolution out of range.");
}
resolution = value;
if(IsRunning)
{
Stop();
Start();
}
}
}
public Mode Mode
{
get
{
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
return mode;
}
set
{
if(disposed)
{
throw new ObjectDisposedException("Timer");
}
mode = value;
if(IsRunning)
{
Stop();
Start();
}
}
}
/// <summary>
/// Gets a value indicating whether the Timer is running.
/// </summary>
public bool IsRunning
{
get
{
return running;
}
}
/// <summary>
/// Gets the timer capabilities.
/// </summary>
public static TimerCaps Capabilities
{
get
{
return caps;
}
}
public event System.EventHandler Disposed;
public ISite Site
{
get
{
return site;
}
set
{
site = value;
}
}
public void Dispose()
{
if(disposed)
{
return;
}
if(IsRunning)
{
Stop();
}
disposed = true;
OnDisposed(EventArgs.Empty);
}
}
public class TimerException : ApplicationException
{
public TimerException(string message) : base(message)
{
}
}
}
+264
View File
@@ -0,0 +1,264 @@
namespace GraphLib
{
partial class PrintPreviewForm
{
/// <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.printPreviewCtrl = new System.Windows.Forms.PrintPreviewControl();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rb_Unscaled = new System.Windows.Forms.RadioButton();
this.rb_BestFit = new System.Windows.Forms.RadioButton();
this.rb_Scale = new System.Windows.Forms.RadioButton();
this.cb_PrintBackground = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.cb_Printer = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.cb_Orientation = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.cb_PaperSize = new System.Windows.Forms.ComboBox();
this.bt_Cancel = new System.Windows.Forms.Button();
this.bt_print = new System.Windows.Forms.Button();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// printPreviewCtrl
//
this.printPreviewCtrl.BackColor = System.Drawing.SystemColors.ControlLight;
this.printPreviewCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.printPreviewCtrl.Location = new System.Drawing.Point(0, 0);
this.printPreviewCtrl.Name = "printPreviewCtrl";
this.printPreviewCtrl.Size = new System.Drawing.Size(453, 501);
this.printPreviewCtrl.TabIndex = 1;
//
// 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";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.printPreviewCtrl);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
this.splitContainer1.Panel2.Controls.Add(this.cb_PrintBackground);
this.splitContainer1.Panel2.Controls.Add(this.label3);
this.splitContainer1.Panel2.Controls.Add(this.cb_Printer);
this.splitContainer1.Panel2.Controls.Add(this.label2);
this.splitContainer1.Panel2.Controls.Add(this.cb_Orientation);
this.splitContainer1.Panel2.Controls.Add(this.label1);
this.splitContainer1.Panel2.Controls.Add(this.cb_PaperSize);
this.splitContainer1.Panel2.Controls.Add(this.bt_Cancel);
this.splitContainer1.Panel2.Controls.Add(this.bt_print);
this.splitContainer1.Size = new System.Drawing.Size(681, 501);
this.splitContainer1.SplitterDistance = 453;
this.splitContainer1.TabIndex = 2;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.rb_Unscaled);
this.groupBox1.Controls.Add(this.rb_BestFit);
this.groupBox1.Controls.Add(this.rb_Scale);
this.groupBox1.Location = new System.Drawing.Point(18, 188);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(93, 93);
this.groupBox1.TabIndex = 12;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Scaling";
//
// rb_Unscaled
//
this.rb_Unscaled.AutoSize = true;
this.rb_Unscaled.Location = new System.Drawing.Point(13, 19);
this.rb_Unscaled.Name = "rb_Unscaled";
this.rb_Unscaled.Size = new System.Drawing.Size(70, 17);
this.rb_Unscaled.TabIndex = 8;
this.rb_Unscaled.TabStop = true;
this.rb_Unscaled.Text = "Unscaled";
this.rb_Unscaled.UseVisualStyleBackColor = true;
this.rb_Unscaled.CheckedChanged += new System.EventHandler(this.rb_Unscaled_CheckedChanged);
//
// rb_BestFit
//
this.rb_BestFit.AutoSize = true;
this.rb_BestFit.Location = new System.Drawing.Point(13, 65);
this.rb_BestFit.Name = "rb_BestFit";
this.rb_BestFit.Size = new System.Drawing.Size(60, 17);
this.rb_BestFit.TabIndex = 6;
this.rb_BestFit.TabStop = true;
this.rb_BestFit.Text = "Best Fit";
this.rb_BestFit.UseVisualStyleBackColor = true;
this.rb_BestFit.CheckedChanged += new System.EventHandler(this.rb_BestFit_CheckedChanged);
//
// rb_Scale
//
this.rb_Scale.AutoSize = true;
this.rb_Scale.Location = new System.Drawing.Point(13, 42);
this.rb_Scale.Name = "rb_Scale";
this.rb_Scale.Size = new System.Drawing.Size(52, 17);
this.rb_Scale.TabIndex = 7;
this.rb_Scale.TabStop = true;
this.rb_Scale.Text = "Scale";
this.rb_Scale.UseVisualStyleBackColor = true;
this.rb_Scale.CheckedChanged += new System.EventHandler(this.rb_Scale_CheckedChanged);
//
// cb_PrintBackground
//
this.cb_PrintBackground.AutoSize = true;
this.cb_PrintBackground.Location = new System.Drawing.Point(22, 321);
this.cb_PrintBackground.Name = "cb_PrintBackground";
this.cb_PrintBackground.Size = new System.Drawing.Size(108, 17);
this.cb_PrintBackground.TabIndex = 11;
this.cb_PrintBackground.Text = "Print Background";
this.cb_PrintBackground.UseVisualStyleBackColor = true;
this.cb_PrintBackground.Visible = false;
this.cb_PrintBackground.CheckedChanged += new System.EventHandler(this.cb_PrintBackground_CheckedChanged);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(19, 29);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(37, 13);
this.label3.TabIndex = 10;
this.label3.Text = "Printer";
//
// cb_Printer
//
this.cb_Printer.FormattingEnabled = true;
this.cb_Printer.Location = new System.Drawing.Point(18, 45);
this.cb_Printer.Name = "cb_Printer";
this.cb_Printer.Size = new System.Drawing.Size(195, 21);
this.cb_Printer.TabIndex = 9;
this.cb_Printer.SelectedIndexChanged += new System.EventHandler(this.cb_Printer_SelectedIndexChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(19, 134);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 5;
this.label2.Text = "Orientation";
//
// cb_Orientation
//
this.cb_Orientation.FormattingEnabled = true;
this.cb_Orientation.Items.AddRange(new object[] {
"Portrait",
"Landscape"});
this.cb_Orientation.Location = new System.Drawing.Point(18, 150);
this.cb_Orientation.Name = "cb_Orientation";
this.cb_Orientation.Size = new System.Drawing.Size(93, 21);
this.cb_Orientation.TabIndex = 4;
this.cb_Orientation.SelectedIndexChanged += new System.EventHandler(this.cb_Orientation_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(19, 81);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(58, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Paper Size";
//
// cb_PaperSize
//
this.cb_PaperSize.FormattingEnabled = true;
this.cb_PaperSize.Location = new System.Drawing.Point(18, 97);
this.cb_PaperSize.Name = "cb_PaperSize";
this.cb_PaperSize.Size = new System.Drawing.Size(93, 21);
this.cb_PaperSize.TabIndex = 2;
this.cb_PaperSize.SelectedIndexChanged += new System.EventHandler(this.cb_PaperSize_SelectedIndexChanged);
//
// bt_Cancel
//
this.bt_Cancel.Location = new System.Drawing.Point(118, 450);
this.bt_Cancel.Name = "bt_Cancel";
this.bt_Cancel.Size = new System.Drawing.Size(69, 26);
this.bt_Cancel.TabIndex = 1;
this.bt_Cancel.Text = "Cancel";
this.bt_Cancel.UseVisualStyleBackColor = true;
this.bt_Cancel.Click += new System.EventHandler(this.bt_Cancel_Click);
//
// bt_print
//
this.bt_print.Location = new System.Drawing.Point(22, 450);
this.bt_print.Name = "bt_print";
this.bt_print.Size = new System.Drawing.Size(69, 26);
this.bt_print.TabIndex = 0;
this.bt_print.Text = "Print";
this.bt_print.UseVisualStyleBackColor = true;
this.bt_print.Click += new System.EventHandler(this.bt_print_Click);
//
// PrintPreviewForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(681, 501);
this.Controls.Add(this.splitContainer1);
this.MaximumSize = new System.Drawing.Size(697, 537);
this.MinimumSize = new System.Drawing.Size(697, 537);
this.Name = "PrintPreviewForm";
this.Text = "PrintPreviewForm";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PrintPreviewControl printPreviewCtrl;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Button bt_Cancel;
private System.Windows.Forms.Button bt_print;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cb_PaperSize;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cb_Orientation;
private System.Windows.Forms.RadioButton rb_Scale;
private System.Windows.Forms.RadioButton rb_BestFit;
private System.Windows.Forms.RadioButton rb_Unscaled;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cb_Printer;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox cb_PrintBackground;
}
}
+336
View File
@@ -0,0 +1,336 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
namespace GraphLib
{
public partial class PrintPreviewForm : Form
{
private PrintDocument printDoc = new PrintDocument();
private PlotterGraphPaneEx gpane = null;
private String strDefaultPrinter = String.Empty;
private bool bBestScale = false;
private bool bPageScale = false;
private bool bUnscaled = false;
private bool bLandscape = false;
private int selPrinterIndex = -1;
public PrintPreviewForm()
{
InitializeComponent();
printPreviewCtrl.Zoom = 1;
rb_BestFit.Checked = true;
rb_Scale.Checked = false;
rb_Unscaled.Checked = false;
cb_Orientation.SelectedIndex = 0;
printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage);
this.VisibleChanged += new EventHandler(OnVisibleChanged);
FormClosing += new FormClosingEventHandler(OnFormClosing);
}
void FillInInstalledPrinters()
{
strDefaultPrinter = printDoc.PrinterSettings.PrinterName;
cb_Printer.Items.Clear();
foreach (String strPrinter in PrinterSettings.InstalledPrinters)
{
cb_Printer.Items.Add(strPrinter);
if (strPrinter == strDefaultPrinter)
{
cb_Printer.SelectedIndex = cb_Printer.Items.IndexOf(strPrinter);
}
}
}
void OnVisibleChanged(object sender, EventArgs e)
{
if (this.Visible)
{
bLandscape = cb_Orientation.SelectedIndex == 1;
FillInInstalledPrinters();
FillInPaperSizes();
UpdateScaleRadioButtons();
InvalidatePrintPreview();
}
else
{
}
}
void OnFormClosing(object sender, FormClosingEventArgs e)
{
this.Hide();
e.Cancel = true;
}
void UpdateScaleRadioButtons()
{
bBestScale = rb_BestFit.Checked;
bPageScale = rb_Scale.Checked;
bUnscaled = rb_Unscaled.Checked;
}
double AutoZoomPreview()
{
float zoom = 1.0f;
float step = 0.05f;
float PaperWidth = printDoc.DefaultPageSettings.PaperSize.Width;
float PaperHeight = printDoc.DefaultPageSettings.PaperSize.Height;
if (bLandscape)
{
PaperHeight = printDoc.DefaultPageSettings.PaperSize.Width * zoom;
PaperWidth = printDoc.DefaultPageSettings.PaperSize.Height * zoom;
}
while (zoom > 0.1f)
{
double CurW = PaperWidth * zoom;
double CurH = PaperHeight * zoom;
if (splitContainer1.Panel1.Width < (CurW+10) || splitContainer1.Panel1.Height < (CurH+10))
{
zoom -= step;
}
else
{
break;
}
}
return zoom;
}
void FillInPaperSizes()
{
cb_PaperSize.Items.Clear();
foreach (PaperSize s in printDoc.PrinterSettings.PaperSizes)
{
cb_PaperSize.Items.Add(s.PaperName.ToString());
}
if (cb_PaperSize.SelectedIndex == -1 || cb_PaperSize.SelectedIndex >= cb_PaperSize.Items.Count)
{
int idx = cb_PaperSize.Items.IndexOf(printDoc.DefaultPageSettings.PaperSize.PaperName);
if (idx >= 0 && idx < cb_PaperSize.Items.Count)
{
cb_PaperSize.SelectedIndex = idx;
}
else
{
cb_PaperSize.SelectedIndex = 0;
}
}
}
void InvalidatePrintPreview()
{
printDoc.DefaultPageSettings.Landscape = bLandscape;
printPreviewCtrl.Document = printDoc;
printPreviewCtrl.Document.DocumentName = "Preview";
printPreviewCtrl.Zoom = AutoZoomPreview();
printPreviewCtrl.InvalidatePreview();
}
public PlotterGraphPaneEx GraphPanel
{
set
{
gpane = value;
}
}
private void AutoScaleDocument(ref float w, ref float h, ref float x, ref float y)
{
float CurGraphWidth = gpane.Width;
float CurGraphHeight = gpane.Height;
float CurPaperWidth = printDoc.DefaultPageSettings.PaperSize.Width;
float CurPaperHeight = printDoc.DefaultPageSettings.PaperSize.Height;
if (bLandscape)
{
CurPaperWidth = printDoc.DefaultPageSettings.PaperSize.Height;
CurPaperHeight = printDoc.DefaultPageSettings.PaperSize.Width;
}
if (bUnscaled)
{
// do nothing
}
if (bPageScale) // scale to page
{
CurGraphWidth = CurPaperWidth;
CurGraphHeight = CurPaperHeight;
}
if (bBestScale) // scale to best fit
{
float zoom = 1.0f;
float step = 0.05f;
if (CurGraphWidth > (CurPaperWidth ) || CurGraphHeight > (CurPaperHeight ))
{
// scale down
while ((zoom * gpane.Width > CurPaperWidth || zoom * gpane.Height > CurPaperHeight) && zoom > step)
{
zoom -= step;
}
zoom -= step;
}
else if (CurGraphWidth < CurPaperWidth && CurGraphHeight < CurPaperHeight)
{
// scale up
while (((zoom+step) * gpane.Width < CurPaperWidth && (zoom+step) * gpane.Height < CurPaperHeight) && zoom > step)
{
zoom += step;
}
}
CurGraphWidth = zoom * gpane.Width;
CurGraphHeight = zoom * gpane.Height;
}
w = CurGraphWidth;
h = CurGraphHeight;
// center print
x = (CurPaperWidth - w) / 2.0f;
y = (CurPaperHeight - h) / 2.0f;
}
private void printDoc_PrintPage(object sender, PrintPageEventArgs e)
{
if (gpane != null)
{
float x=0, y=0, w=gpane.Width, h=gpane.Height;
AutoScaleDocument(ref w, ref h, ref x, ref y);
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
//gpane.PaintControl(e.Graphics, w, h,x,y,cb_PrintBackground.Checked);
gpane.PaintControl(e.Graphics, w, h, x, y, false);
}
}
private void bt_print_Click(object sender, EventArgs e)
{
if (printDoc != null)
{
printDoc.Print();
this.Hide();
}
}
private void bt_Cancel_Click(object sender, EventArgs e)
{
this.Hide();
}
private void cb_PaperSize_SelectedIndexChanged(object sender, EventArgs e)
{
if (cb_PaperSize.SelectedIndex >= 0 && cb_PaperSize.SelectedIndex < cb_PaperSize.Items.Count)
{
foreach (PaperSize s in printDoc.PrinterSettings.PaperSizes)
{
if (s.PaperName == (string)cb_PaperSize.Items[cb_PaperSize.SelectedIndex])
{
printDoc.DefaultPageSettings.PaperSize = s;
InvalidatePrintPreview();
}
}
}
}
private void rb_BestFit_CheckedChanged(object sender, EventArgs e)
{
if (rb_BestFit.Checked)
{
rb_Scale.Checked = !rb_BestFit.Checked;
rb_Unscaled.Checked = !rb_BestFit.Checked;
}
UpdateScaleRadioButtons();
InvalidatePrintPreview();
}
private void rb_Scale_CheckedChanged(object sender, EventArgs e)
{
if (rb_Scale.Checked)
{
rb_BestFit.Checked = !rb_Scale.Checked;
rb_Unscaled.Checked = !rb_Scale.Checked;
}
UpdateScaleRadioButtons();
InvalidatePrintPreview();
}
private void rb_Unscaled_CheckedChanged(object sender, EventArgs e)
{
if (rb_Unscaled.Checked)
{
rb_Scale.Checked = !rb_Unscaled.Checked;
rb_BestFit.Checked = !rb_Unscaled.Checked;
}
UpdateScaleRadioButtons();
InvalidatePrintPreview();
}
private void cb_Printer_SelectedIndexChanged(object sender, EventArgs e)
{
selPrinterIndex = cb_Printer.SelectedIndex;
if (selPrinterIndex >= 0 && selPrinterIndex < cb_Printer.Items.Count)
{
printDoc.PrinterSettings.PrinterName = (string)cb_Printer.Items[selPrinterIndex];
this.Text = "Print Preview - " + printDoc.PrinterSettings.PrinterName;
}
FillInPaperSizes();
InvalidatePrintPreview();
}
private void cb_Orientation_SelectedIndexChanged(object sender, EventArgs e)
{
if (cb_Orientation.SelectedIndex == 0)
{
bLandscape = false;
}
else
{
bLandscape = true;
}
InvalidatePrintPreview();
}
private void cb_PrintBackground_CheckedChanged(object sender, EventArgs e)
{
InvalidatePrintPreview();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+35
View File
@@ -0,0 +1,35 @@
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("GraphLibrary")]
[assembly: AssemblyDescription("Library for easy and simple graph drawing")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GraphLibrary")]
[assembly: AssemblyCopyright("Copyright © 2008-2014 ZIMMERMANN STEPHAN")]
[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("b23e30ac-c4b8-4863-90d0-cf0ad837c050")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.18408
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ClassLibrary1.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClassLibrary1.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+45
View File
@@ -0,0 +1,45 @@
using System;
namespace GraphLib
{
public class Utilities
{
/// <summary>
/// returns the most significant decimal digit
/// 250 -> 100
/// 350 -> 100
/// 12 -> 10
/// 5 -> 1
/// 0.5 .> 0.1
/// .....
/// </summary>
/// <param name="Value"></param>
/// <returns></returns>
static public float MostSignificantDigit(float Value)
{
float n = 1;
float val_abs = Math.Abs(Value);
float sig = 1.0f * Math.Sign(Value);
if (val_abs > 1)
{
while (n < val_abs)
{
n *= 10.0f;
}
return (float)((int)(sig * n / 10));
}
else // n <= 1
{
while (n > val_abs)
{
n /= 10.0f;
}
return sig * n;
}
}
}
}
+68
View File
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class Part
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual string OraDBType { get; set; }
public virtual string Description { get; set; }
public virtual CodeType CodeType { get; set; }
public virtual CodeForm CodeForm { get; set; }
public virtual CodeLocation CodeLocation { get; set; }
public virtual LifetimeManagement LifetimeManagement { get; set; }
public virtual int StepNumber { get; set; }
public virtual Process Process { get; set; }
public virtual Workstep Workstep { get; set; }
protected Part()
{
Name = string.Empty;
Description = string.Empty;
}
/// <summary>
/// Constructor used when the part is added to a process
/// </summary>
/// <param name="name"></param>
/// <param name="codeType"></param>
/// <param name="codeForm"></param>
/// <param name="process"></param>
public Part(string name, Process process, CodeType codeType, CodeForm codeForm, CodeLocation codeLocation)
{
Name = name;
OraDBType = string.Empty;
Description = string.Empty;
CodeType = codeType;
CodeForm = codeForm;
CodeLocation = codeLocation;
StepNumber = 0;
Process = process;
Workstep = null;
}
/// <summary>
/// Create a copy of a part (1) belongig to another process, (2) not assigned to any workstep yet.
/// </summary>
/// <param name="process">Process owning the cloned part</param>
/// <returns>Cloned part</returns>
public virtual Part Clone(Process owningProcess)
{
Part rslt = new Part(Name, owningProcess, CodeType, CodeForm, CodeLocation);
rslt.OraDBType = OraDBType;
rslt.Description = Description;
rslt.LifetimeManagement = LifetimeManagement;
return rslt;
}
public override string ToString()
{
return string.Format("{0} step={1} ({2})", Name, StepNumber, Description);
}
}
}
+68
View File
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class Process
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual ReleaseStatus ReleaseStatus { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual string UserName { get; set; }
public virtual IList<Part> Parts { get; set; }
public virtual IList<Workstep> Worksteps { get; set; }
/// <summary>
/// Default (private) constructor inicializing lists
/// </summary>
protected Process()
{
Parts = new List<Part>();
Worksteps = new List<Workstep>();
}
/// <summary>
/// Constructor used when this process is created
/// </summary>
/// <param name="name"></param>
public Process(string name)
: this()
{
Name = name;
Description = string.Empty;
ReleaseStatus = ReleaseStatus.In_preparation;
TimeStamp = DateTime.Now;
UserName = "admin";
}
/// <summary>
/// Create a copy of a process with a new name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public virtual Process Clone(string name)
{
Process rslt = new Process(name);
rslt.Description = Description;
foreach (var part in Parts) rslt.Parts.Add(part.Clone(rslt));
foreach (var workstep in Worksteps) rslt.Worksteps.Add(workstep.Clone(rslt));
return rslt;
}
public override string ToString()
{
return string.Format("{0} '{1}' ({2}) {3} {4}",
ItemNr,
Name,
TimeStamp.Date.ToShortDateString(),
(Description == null) ? string.Empty : Description,
ReleaseStatus);
}
}
}
+61
View File
@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class Record
{
public virtual int Id { get; protected set; }
public virtual string Code { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual Part Part { get; set; }
public virtual ReferenceRecord ReferenceRecord { get; set; }
protected Record()
{
}
/// <summary>
/// Constructor used when a part barcode is scanned
/// </summary>
/// <param name="partId">Part</param>
/// <param name="referenceRecordId">Reference record</param>
/// <param name="code">Scanned barcode</param>
public Record(Part part, ReferenceRecord referenceRecord, string code)
{
Part = part;
ReferenceRecord = referenceRecord;
Code = code;
TimeStamp = DateTime.Now;
}
/// <summary>
/// Create a copy of a process with a new name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public virtual Record Clone(Process newProcess, ReferenceRecord newRR)
{
Part newPart = null;
foreach (var pt in newProcess.Parts)
{
if (Part.Name == pt.Name)
{
newPart = pt;
break;
}
}
Record rslt = new Record(newPart, newRR, Code);
rslt.TimeStamp = TimeStamp;
return rslt;
}
public override string ToString()
{
return string.Format("code={0} part={1} description='{2}'", Code, Part.Name, Part.Description);
}
}
}
+88
View File
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class ReferenceRecord
{
public virtual int Id { get; protected set; }
public virtual string Code { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual string UserName { get; set; }
public virtual string Workplace { get; set; }
public virtual int Result { get; set; } /// 0 = No error (OK), >0 = Error code
public virtual Process Process { get; set; }
public virtual Workstep Workstep { get; set; }
public virtual IList<Record> Records { get; set; }
/// <summary>
/// Default (private) constructor inicializing lists
/// </summary>
protected ReferenceRecord()
{
Records = new List<Record>();
}
/// <summary>
/// Constructor used when reference barcode is scanned
/// </summary>
/// <param name="process">Process</param>
/// <param name="workstep">Workstep</param>
/// <param name="code">Scanned barcode</param>
public ReferenceRecord(Process process, Workstep workstep, string code,
string userName, string workplace, int result)
{
Process = process;
Workstep = workstep;
Code = code;
TimeStamp = DateTime.Now;
UserName = userName;
Workplace = workplace;
Result = result;
}
/// <summary>
/// Create a copy of a process with a new name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public virtual ReferenceRecord Clone(Process newProcess)
{
Workstep newWorkstep = null;
foreach (var ws in newProcess.Worksteps)
{
if (Workstep.Name == ws.Name)
{
newWorkstep = ws;
break;
}
}
ReferenceRecord rslt = new ReferenceRecord(newProcess, newWorkstep,
Code, UserName, Workplace, Result);
rslt.TimeStamp = TimeStamp;
rslt.Records = new List<Record>();
foreach (var record in Records)
{
rslt.Records.Add(record.Clone(newProcess, rslt));
}
return rslt;
}
public override string ToString()
{
return string.Format("code={0} part={1} description='{2}' step='{3}' workplace='{4}' user={5} time={6:dd.MM.yyyy HH:mm:ss}",
(Code != null) ? Code : "<none>",
Workstep.ReferencePart.Name,
Workstep.ReferencePart.Description,
Workstep.Name,
Workplace,
UserName,
TimeStamp);
}
}
}
+82
View File
@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class Workstep
{
public virtual int Id { get; protected set; }
public virtual int WorkstepNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual int CheckPartNr { get; set; }
public virtual bool AllowRepairs { get; set; }
public virtual Process Process { get; set; }
public virtual Part ReferencePart { get; set; }
public virtual IList<Part> Parts { get; set; }
/// <summary>
/// Default (private) constructor inicializing a list
/// </summary>
protected Workstep()
{
Parts = new List<Part>();
}
/// <summary>
/// Constructor used when this workstep is added to a process
/// </summary>
/// <param name="name">Workstep name</param>
/// <param name="process">Process to be referenced</param>
public Workstep(int workstepNr, string name, Process process)
: this()
{
WorkstepNr = workstepNr;
Name = name;
Description = string.Empty;
CheckPartNr = 0;
AllowRepairs = false;
Process = process;
ReferencePart = null;
}
public virtual Workstep Clone(Process owningProcess)
{
Workstep rslt = new Workstep(WorkstepNr, Name, owningProcess);
rslt.Description = Description;
rslt.CheckPartNr = CheckPartNr;
rslt.AllowRepairs = AllowRepairs;
if (ReferencePart != null)
{
foreach (var p in owningProcess.Parts)
{
if (p.Name == ReferencePart.Name) rslt.ReferencePart = p;
}
}
foreach (var srcP in Parts)
{
foreach (var p in owningProcess.Parts)
{
if (p.Name == srcP.Name)
{
rslt.Parts.Add(p);
p.StepNumber = srcP.StepNumber;
p.Workstep = rslt;
}
}
}
return rslt;
}
public override string ToString()
{
//return string.Format("{0} {1} ({2}) Ref: {3}", WorkstepNr, Name, Description, (ReferencePart != null) ? ReferencePart.Name : "none");
return string.Format("{0}: {1}", WorkstepNr, Name);
}
}
}
+94
View File
@@ -0,0 +1,94 @@
namespace MonitoringDB
{
public enum CodeType
{
UniqueNr,
FlowtubeNr, /// prvé 3 znaky sa zhodujú s poslednými 3 znakmi názvu
FlowtubeNrLU, /// začiatok kódu sa zhoduje s názvom
BatchNr,
BatchNrContainingPartName,
DateMMYY,
QualityCheck,
}
public enum CodeForm
{
Barcode,
QRCode,
Keyboard,
OkNok,
}
public enum CodeLocation
{
OnPart,
OnPallet,
}
public enum LifetimeManagement
{
None,
OneYear,
Count,
}
public enum ReleaseStatus
{
In_preparation,
Released,
ReleasedActive,
Deactivated,
Count,
}
public enum Mode
{
Debug, // Debug mode - no Oracle database used
Test, // Test database used
Production, // Production database used
Count,
}
public enum LoginLevel
{
None,
TeamLeader,
Administrator,
MH,
Count,
}
public enum ItemSpecID
{
RefRecordID = 0,
TimeStamp,
Workstep,
Workplace,
UserName,
Barcode,
PartBarcode,
TimeStamp2,
Workstep2,
Workplace2,
UserName2,
Barcode2,
PartBarcode2,
SerialNr,
PurchaseOrder,
TestResult,
MaxPruefindex,
Process,
}
public enum ItemSpecCaps
{
None = 0,
ReferenceRecord = 1,
AssociatedRecord = 2,
OracleQuery = 4,
}
}
+212
View File
@@ -0,0 +1,212 @@
using System;
using System.Collections.Generic;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
namespace MonitoringDB
{
public static class FluentNH
{
/// <summary>
/// Current session factory for the last used connection string or null
/// </summary>
public static ISessionFactory SessionFactory;
/// <summary> Connection string for all sessions </summary>
static string connectionString;
///
public static string ConnectionString
{
get { return connectionString; }
set
{
if (value != connectionString)
{
connectionString = value;
SessionFactory = null; /// Clear SessionFactory on connection string change
}
}
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
static ISessionFactory CreateSessionFactory()
{
return CreateSessionFactory(false);
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
public static ISessionFactory CreateSessionFactory(bool createDB)
{
FluentConfiguration cfg = Fluently
.Configure()
.Database(MySQLConfiguration.Standard.ConnectionString(connectionString))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.Process>());
if (createDB)
{
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
}
else
{
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
}
}
public delegate void BuildSchemaDlgt(Configuration config);
public static void BuildSchema(Configuration config)
{
/// This NHibernate tool takes a configuration (with mapping info in)
/// and exports a database schema from it
new SchemaExport(config).SetOutputFile("db_schema");
}
static void BuildSchemaCreate(Configuration config)
{
/// This NHibernate tool takes a configuration (with mapping info in)
/// and exports a database schema from it
new SchemaExport(config).Create(true, true);
}
/// Create a NHibernate session for the given database
public static ISession CreateSession(string connectionString)
{
ConnectionString = connectionString; /// Clears session factory on connction string change
if (SessionFactory == null)
SessionFactory = CreateSessionFactory();
return SessionFactory.OpenSession();
}
/// <summary>
/// Create an empty database.
/// Database contains only the user 'admin' and the control board component 'CB'.
/// </summary>
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
/// <param name="connectionString">Connection string</param>
/// <returns>true=success, false=error</returns>
public static bool CreateEmptyDB(string connectionString)
{
ConnectionString = connectionString;
ISessionFactory sessionFactory = CreateSessionFactory(true);
if (sessionFactory == null) return false;
/// Populate the database
using (var session = sessionFactory.OpenSession())
{
//using (var transaction = session.BeginTransaction())
//{
// var part1 = new MonitoringDB.Entities.Part("flow tube", CodeType.UniqueNr, CodeForm.QRCode, 0);
// session.SaveOrUpdate(part1);
// transaction.Commit();
//}
}
return true;
}
public static IList<WMPart> FindWMParts(string pcbNumber, string connString)
{
IList<WMPart> foundParts = new List<WMPart>(); /// initially empty
if (string.IsNullOrEmpty(pcbNumber)) return foundParts; /// return an empty list
try
{
ISession session = CreateSession(connString);
IList<Entities.ReferenceRecord> referenceRecords = session
.QueryOver<Entities.ReferenceRecord>()
.Where(x => (x.Code == pcbNumber))
.OrderBy(x => x.TimeStamp).Desc
.List<Entities.ReferenceRecord>();
if (referenceRecords.Count == 0) return foundParts;
foundParts.Add(new WMPart(referenceRecords[0]));
Entities.Process process = referenceRecords[0].Process;
///
foreach (var refR in referenceRecords)
{
if (process != refR.Process)
{
continue; /// skip records obtained by another process
}
IList<Entities.Record> relatedRecords = session
.QueryOver<Entities.Record>()
.Where(x => (x.ReferenceRecord == refR))
.List<Entities.Record>();
foreach (var relR in relatedRecords)
{
foundParts.Add(new WMPart(relR));
foreach (var ws in process.Worksteps)
{
if (ws.ReferencePart == relR.Part)
{
FindWMPartsRecursively(process, ws.ReferencePart, relR.Code, session, ref foundParts);
}
}
}
}
}
catch
{
}
return foundParts;
}
static void FindWMPartsRecursively(Entities.Process process, Entities.Part refPart, string code, ISession session, ref IList<WMPart> foundParts)
{
IList<Entities.ReferenceRecord> referenceRecords = session
.QueryOver<Entities.ReferenceRecord>()
.Where(x => (x.Workstep.ReferencePart == refPart))
.Where(x => (x.Code == code))
.OrderBy(x => x.TimeStamp).Desc
.List<Entities.ReferenceRecord>();
if (referenceRecords.Count == 0) return;
foreach (var refR in referenceRecords)
{
IList<Entities.Record> relatedRecords = session
.QueryOver<Entities.Record>()
.Where(x => (x.ReferenceRecord == refR))
.List<Entities.Record>();
foreach (var relR in relatedRecords)
{
foundParts.Add(new WMPart(relR));
foreach (var ws in process.Worksteps)
{
if (ws.ReferencePart == relR.Part)
{
FindWMPartsRecursively(process, ws.ReferencePart, relR.Code, session, ref foundParts);
}
}
}
}
}
}
}
+456
View File
@@ -0,0 +1,456 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace MonitoringDB.Forms
{
/// <summary>
/// Event Handler for SubItem events
/// </summary>
public delegate void SubItemEventHandler(object sender, SubItemEventArgs e);
/// <summary>
/// Event Handler for SubItemEndEditing events
/// </summary>
public delegate void SubItemEndEditingEventHandler(object sender, SubItemEndEditingEventArgs e);
/// <summary>
/// Inherited ListView to allow in-place editing of subitems
/// </summary>
public class ListViewEx : System.Windows.Forms.ListView
{
#region Interop structs, imports and constants
/// <summary>
/// MessageHeader for WM_NOTIFY
/// </summary>
private struct NMHDR
{
#pragma warning disable
public IntPtr hwndFrom;
public Int32 idFrom;
public Int32 code;
#pragma warning restore
}
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar);
[DllImport("user32.dll", CharSet=CharSet.Ansi)]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int len, ref int [] order);
// ListView messages
private const int LVM_FIRST = 0x1000;
private const int LVM_GETCOLUMNORDERARRAY = (LVM_FIRST + 59);
// Windows Messages that will abort editing
private const int WM_HSCROLL = 0x114;
private const int WM_VSCROLL = 0x115;
private const int WM_SIZE = 0x05;
private const int WM_NOTIFY = 0x4E;
private const int HDN_FIRST = -300;
private const int HDN_BEGINDRAG = (HDN_FIRST-10);
private const int HDN_ITEMCHANGINGA = (HDN_FIRST-0);
private const int HDN_ITEMCHANGINGW = (HDN_FIRST-20);
#endregion
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public event SubItemEventHandler SubItemClicked;
public event SubItemEventHandler SubItemBeginEditing;
public event SubItemEndEditingEventHandler SubItemEndEditing;
public ListViewEx()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
base.FullRowSelect = true;
base.View = View.Details;
base.AllowColumnReorder = true;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( 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()
{
components = new System.ComponentModel.Container();
}
#endregion
private bool _doubleClickActivation = false;
/// <summary>
/// Is a double click required to start editing a cell?
/// </summary>
public bool DoubleClickActivation
{
get { return _doubleClickActivation; }
set { _doubleClickActivation = value; }
}
/// <summary>
/// Retrieve the order in which columns appear
/// </summary>
/// <returns>Current display order of column indices</returns>
public int[] GetColumnOrder()
{
IntPtr lPar = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * Columns.Count);
IntPtr res = SendMessage(Handle, LVM_GETCOLUMNORDERARRAY, new IntPtr(Columns.Count), lPar);
if (res.ToInt32() == 0) // Something went wrong
{
Marshal.FreeHGlobal(lPar);
return null;
}
int [] order = new int[Columns.Count];
Marshal.Copy(lPar, order, 0, Columns.Count);
Marshal.FreeHGlobal(lPar);
return order;
}
/// <summary>
/// Find ListViewItem and SubItem Index at position (x,y)
/// </summary>
/// <param name="x">relative to ListView</param>
/// <param name="y">relative to ListView</param>
/// <param name="item">Item at position (x,y)</param>
/// <returns>SubItem index</returns>
public int GetSubItemAt(int x, int y, out ListViewItem item)
{
item = this.GetItemAt(x, y);
if (item != null)
{
int[] order = GetColumnOrder();
Rectangle lviBounds;
int subItemX;
lviBounds = item.GetBounds(ItemBoundsPortion.Entire);
subItemX = lviBounds.Left;
for (int i=0; i<order.Length; i++)
{
ColumnHeader h = this.Columns[order[i]];
if (x < subItemX+h.Width)
{
return h.Index;
}
subItemX += h.Width;
}
}
return -1;
}
/// <summary>
/// Get bounds for a SubItem
/// </summary>
/// <param name="Item">Target ListViewItem</param>
/// <param name="SubItem">Target SubItem index</param>
/// <returns>Bounds of SubItem (relative to ListView)</returns>
public Rectangle GetSubItemBounds(ListViewItem Item, int SubItem)
{
int[] order = GetColumnOrder();
Rectangle subItemRect = Rectangle.Empty;
if (SubItem >= order.Length)
throw new IndexOutOfRangeException("SubItem "+SubItem+" out of range");
if (Item == null)
throw new ArgumentNullException("Item");
Rectangle lviBounds = Item.GetBounds(ItemBoundsPortion.Entire);
int subItemX = lviBounds.Left;
ColumnHeader col;
int i;
for (i=0; i<order.Length; i++)
{
col = this.Columns[order[i]];
if (col.Index == SubItem)
break;
subItemX += col.Width;
}
subItemRect = new Rectangle(subItemX, lviBounds.Top, this.Columns[order[i]].Width, lviBounds.Height);
return subItemRect;
}
protected override void WndProc(ref Message msg)
{
switch (msg.Msg)
{
// Look for WM_VSCROLL,WM_HSCROLL or WM_SIZE messages.
case WM_VSCROLL:
case WM_HSCROLL:
case WM_SIZE:
EndEditing(false);
break;
case WM_NOTIFY:
// Look for WM_NOTIFY of events that might also change the
// editor's position/size: Column reordering or resizing
NMHDR h = (NMHDR)Marshal.PtrToStructure(msg.LParam, typeof(NMHDR));
if (h.code == HDN_BEGINDRAG ||
h.code == HDN_ITEMCHANGINGA ||
h.code == HDN_ITEMCHANGINGW)
EndEditing(false);
break;
}
base.WndProc(ref msg);
}
#region Initialize editing depending of DoubleClickActivation property
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
base.OnMouseUp(e);
if (DoubleClickActivation)
{
return;
}
EditSubitemAt(new Point(e.X, e.Y));
}
protected override void OnDoubleClick(EventArgs e)
{
base.OnDoubleClick (e);
if (!DoubleClickActivation)
{
return;
}
Point pt = this.PointToClient(Cursor.Position);
EditSubitemAt(pt);
}
///<summary>
/// Fire SubItemClicked
///</summary>
///<param name="p">Point of click/doubleclick</param>
private void EditSubitemAt(Point p)
{
ListViewItem item;
int idx = GetSubItemAt(p.X, p.Y, out item);
if (idx >= 0)
{
OnSubItemClicked(new SubItemEventArgs(item, idx));
}
}
#endregion
#region In-place editing functions
// The control performing the actual editing
private Control _editingControl;
// The LVI being edited
private ListViewItem _editItem;
// The SubItem being edited
private int _editSubItem;
protected void OnSubItemBeginEditing(SubItemEventArgs e)
{
if (SubItemBeginEditing != null) SubItemBeginEditing(this, e);
}
protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
{
if (SubItemEndEditing != null) SubItemEndEditing(this, e);
}
protected void OnSubItemClicked(SubItemEventArgs e)
{
if (SubItemClicked != null) SubItemClicked(this, e);
}
/// <summary>
/// Begin in-place editing of given cell
/// </summary>
/// <param name="c">Control used as cell editor</param>
/// <param name="Item">ListViewItem to edit</param>
/// <param name="SubItem">SubItem index to edit</param>
public void StartEditing(Control c, ListViewItem Item, int SubItem)
{
OnSubItemBeginEditing(new SubItemEventArgs(Item, SubItem));
Rectangle rcSubItem = GetSubItemBounds(Item, SubItem);
if (rcSubItem.X < 0)
{
// Left edge of SubItem not visible - adjust rectangle position and width
rcSubItem.Width += rcSubItem.X;
rcSubItem.X=0;
}
if (rcSubItem.X+rcSubItem.Width > this.Width)
{
// Right edge of SubItem not visible - adjust rectangle width
rcSubItem.Width = this.Width-rcSubItem.Left;
}
// Subitem bounds are relative to the location of the ListView!
rcSubItem.Offset(Left, Top);
// In case the editing control and the listview are on different parents,
// account for different origins
Point origin = new Point(0,0);
Point lvOrigin = this.Parent.PointToScreen(origin);
Point ctlOrigin = c.Parent.PointToScreen(origin);
rcSubItem.Offset(lvOrigin.X-ctlOrigin.X, lvOrigin.Y-ctlOrigin.Y);
// Position and show editor
c.Bounds = rcSubItem;
c.Text = Item.SubItems[SubItem].Text;
c.Visible = true;
c.BringToFront();
c.Focus();
_editingControl = c;
_editingControl.Leave += new EventHandler(_editControl_Leave);
_editingControl.KeyPress += new KeyPressEventHandler(_editControl_KeyPress);
_editItem = Item;
_editSubItem = SubItem;
}
private void _editControl_Leave(object sender, EventArgs e)
{
// cell editor losing focus
EndEditing(true);
}
private void _editControl_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
switch (e.KeyChar)
{
case (char)(int)Keys.Escape:
{
EndEditing(false);
break;
}
case (char)(int)Keys.Enter:
{
EndEditing(true);
break;
}
}
}
/// <summary>
/// Accept or discard current value of cell editor control
/// </summary>
/// <param name="AcceptChanges">Use the _editingControl's Text as new SubItem text or discard changes?</param>
public void EndEditing(bool AcceptChanges)
{
if (_editingControl == null)
return;
SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs(
_editItem, // The item being edited
_editSubItem, // The subitem index being edited
AcceptChanges ?
_editingControl.Text : // Use editControl text if changes are accepted
_editItem.SubItems[_editSubItem].Text, // or the original subitem's text, if changes are discarded
!AcceptChanges // Cancel?
);
OnSubItemEndEditing(e);
_editItem.SubItems[_editSubItem].Text = e.DisplayText;
_editingControl.Leave -= new EventHandler(_editControl_Leave);
_editingControl.KeyPress -= new KeyPressEventHandler(_editControl_KeyPress);
_editingControl.Visible = false;
_editingControl = null;
_editItem = null;
_editSubItem = -1;
}
#endregion
}
/// <summary>
/// Event Args for SubItemClicked event
/// </summary>
public class SubItemEventArgs : EventArgs
{
int subItem = -1; /// Sub-item index
ListViewItem item = null;
public int SubItem { get { return subItem; } }
public ListViewItem Item { get { return item; } }
public SubItemEventArgs(ListViewItem item, int subItem)
{
this.subItem = subItem;
this.item = item;
}
}
/// <summary>
/// Event Args for SubItemEndEditingClicked event
/// </summary>
public class SubItemEndEditingEventArgs : SubItemEventArgs
{
string displayText = string.Empty;
bool cancel = true;
public SubItemEndEditingEventArgs(ListViewItem item, int subItem, string displayText, bool cancel) :
base(item, subItem)
{
this.displayText = displayText;
this.cancel = cancel;
}
public string DisplayText
{
get { return displayText; }
set { displayText = value; }
}
public bool Cancel
{
get { return cancel; }
set { cancel = value; }
}
}
}
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="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" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+64
View File
@@ -0,0 +1,64 @@
namespace MonitoringDB.Forms
{
partial class ModelessForm
{
/// <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.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(47, 29);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// ModelessForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(191, 56);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ModelessForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ModelessForm";
this.Load += new System.EventHandler(this.ModelessForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
}
}
+68
View File
@@ -0,0 +1,68 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class ModelessForm : Form
{
/// <summary>
/// Called from the state machine when an operation forces a modeless dialog close.
/// </summary>
public static void CloseForm()
{
if (CloseFormHandler == null) return;
try { CloseFormHandler(null, null); }
catch (Exception) { }
}
public static event EventHandler<EventArgs> CloseFormHandler;
void OnCloseForm(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
public string Title;
public string Message;
public Color BackgroundColor;
public Color TextColor;
public Font TextFont;
public string FontFamily;
public int FontSize;
public FontStyle FontStyle;
/// <summary>
/// Constructor to be used by the application
/// </summary>
/// <param name="title">Window title</param>
/// <param name="message">Displayed message</param>
public ModelessForm()
{
InitializeComponent();
ControlBox = false;
CloseFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnCloseForm), sender, args); }
else OnCloseForm(sender, args);
};
}
private void ModelessForm_Load(object sender, EventArgs e)
{
if (Title != null) Text = Title;
if (Message != null) label1.Text = Message;
if (BackgroundColor != null) BackColor = BackgroundColor;
if (TextColor != null) ForeColor = TextColor;
if (FontFamily != null) label1.Font = new Font(FontFamily, FontSize, FontStyle);
float textWidth = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(label1.Text, label1.Font).Width;
float textHeight = Graphics.FromImage(new Bitmap(1, 1)).MeasureString(label1.Text, label1.Font).Height;
Width = (int)textWidth + 120; /// Form width calculated from the text width
Height += (int)textHeight; /// Form height calculated from the text height
}
}
}
+299
View File
@@ -0,0 +1,299 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using MonitoringDB.Entities;
using MonitoringDB.Resources;
namespace MonitoringDB.Forms
{
public partial class ResultsConfigDlg : Form
{
/// <summary>
/// ListViewEx columns
/// </summary>
enum Column
{
Item,
Caption,
Format,
Precision,
Width,
Count,
}
Control[] editors;
public IList<ItemSpec> AvailableItems;
public IList<ItemSpec> SelectedItems;
public bool Compound; /// false = single meter items, true = combined meter items
public ResultsConfigDlg()
{
InitializeComponent();
}
void Localize()
{
Text = Strings.Configuration;
availableResultsLabel.Text = Strings.Available_results;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
upButton.Text = Strings.UpBtnText;
downButton.Text = Strings.DownBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
/// Add columns to ListViewEx
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Item, Width = 120 });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Caption });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Format });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Precision });
selectedResultsListViewEx.Columns.Add(new ColumnHeader { Text = Strings.Width });
editors = new Control[]
{
null,
new TextBox(),
new TextBox(),
new TextBox(),
new TextBox(),
};
foreach (var edi in editors)
{
if (edi != null)
{
edi.Visible = false;
Controls.Add(edi);
}
}
selectedResultsListViewEx.SubItemClicked += new SubItemEventHandler(selectedResultsListViewEx_SubItemClicked);
selectedResultsListViewEx.SubItemEndEditing += new SubItemEndEditingEventHandler(selectedResultsListViewEx_SubItemEndEditing);
RedrawAvailable();
RedrawSelected();
}
void selectedResultsListViewEx_SubItemClicked(object sender, SubItemEventArgs e)
{
if ((e.SubItem > 0) && (e.SubItem < (int)Column.Count))
{
selectedResultsListViewEx.StartEditing(editors[e.SubItem], e.Item, e.SubItem);
}
}
void selectedResultsListViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
ListViewItem lvi = e.Item;
ItemSpec item = lvi.Tag as ItemSpec;
switch ((Column)e.SubItem)
{
case Column.Caption: item.Caption = e.DisplayText; return;
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
}
default:
return; /// OK
}
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
return;
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawAvailable()
{
availableResultsListBox.Items.Clear();
AvailableItems = new List<ItemSpec>();
foreach (var item in ItemSpec.AllItems)
{
AvailableItems.Add(item);
availableResultsListBox.Items.Add(item.Name);
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListViewEx.Items.Clear();
foreach (var item in SelectedItems)
{
ListViewItem lvi = new ListViewItem(item.Name); /// Item
lvi.Tag = item;
lvi.SubItems.Add(item.Caption); /// Header
lvi.SubItems.Add(item.Format); /// Format
lvi.SubItems.Add(item.Precision); /// Precision
lvi.SubItems.Add(item.Width.ToString()); /// Width
selectedResultsListViewEx.Items.Add(lvi);
}
}
void UpdateSelectedFromView()
{
}
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--)
{
var oriItem = AvailableItems[availableResultsListBox.SelectedIndices[i]];
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();
}
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListViewEx.SelectedIndices.Count == 1)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListViewEx.SelectedIndices.Count - 1; i >= 0; i--)
{
SelectedItems.RemoveAt(selectedResultsListViewEx.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
SelectedItems.Clear();
RedrawAvailable();
RedrawSelected();
}
void okButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void ResultsConfigDlg_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void upButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == 0)
{
/// Cannot move up
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[0].Selected = true;
return;
}
ItemSpec tmp = SelectedItems[selIdx - 1];
SelectedItems[selIdx - 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx - 1].Selected = true;
selectedResultsListViewEx.Items[selIdx - 1].EnsureVisible();
}
private void downButton_Click(object sender, EventArgs e)
{
if (selectedResultsListViewEx.SelectedIndices.Count != 1) return;
int selIdx = selectedResultsListViewEx.SelectedIndices[0];
if (selIdx == SelectedItems.Count - 1)
{
/// Cannot move down
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[SelectedItems.Count - 1].Selected = true;
return;
}
ItemSpec tmp = SelectedItems[selIdx + 1];
SelectedItems[selIdx + 1] = SelectedItems[selIdx];
SelectedItems[selIdx] = tmp;
RedrawSelected();
selectedResultsListViewEx.Focus();
selectedResultsListViewEx.Items[selIdx + 1].Selected = true;
selectedResultsListViewEx.Items[selIdx + 1].EnsureVisible();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+201
View File
@@ -0,0 +1,201 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
namespace MonitoringDB.Forms
{
partial class ResultsConfigDlg
{
/// <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.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 MonitoringDB.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 MonitoringDB.Forms.SubItemEventHandler(this.selectedResultsListViewEx_SubItemClicked);
this.selectedResultsListViewEx.SubItemEndEditing += new MonitoringDB.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();
}
#endregion
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;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private ListViewEx selectedResultsListViewEx;
private System.Windows.Forms.Button upButton;
private System.Windows.Forms.Button downButton;
}
}
+263
View File
@@ -0,0 +1,263 @@
namespace MonitoringDB.Forms
{
partial class SettingsDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.connectionStringTextBox = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.workplaceNameTextBox = new System.Windows.Forms.TextBox();
this.saveButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.extraBatteryLifetimeTextBox = new System.Windows.Forms.TextBox();
this.oracleGroupBox = new System.Windows.Forms.GroupBox();
this.checkPcbIsInOracleCheckBox = new System.Windows.Forms.CheckBox();
this.oracleBatteryCheckBox = new System.Windows.Forms.CheckBox();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.usersDBConnStringTextBox = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.oracleGroupBox.SuspendLayout();
this.groupBox5.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.connectionStringTextBox);
this.groupBox1.Location = new System.Drawing.Point(12, 69);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(622, 50);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Connection string pre záznamy z výroby";
//
// connectionStringTextBox
//
this.connectionStringTextBox.Location = new System.Drawing.Point(17, 18);
this.connectionStringTextBox.Name = "connectionStringTextBox";
this.connectionStringTextBox.Size = new System.Drawing.Size(586, 20);
this.connectionStringTextBox.TabIndex = 0;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.radioButton2);
this.groupBox2.Controls.Add(this.radioButton1);
this.groupBox2.Location = new System.Drawing.Point(12, 250);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(268, 70);
this.groupBox2.TabIndex = 4;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Režim činnosti";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(101, 41);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(58, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "Výroba";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Location = new System.Drawing.Point(101, 20);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(46, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Test";
this.radioButton1.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.workplaceNameTextBox);
this.groupBox3.Location = new System.Drawing.Point(12, 12);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(622, 50);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Meno pracoviska";
//
// workplaceNameTextBox
//
this.workplaceNameTextBox.Location = new System.Drawing.Point(17, 18);
this.workplaceNameTextBox.Name = "workplaceNameTextBox";
this.workplaceNameTextBox.Size = new System.Drawing.Size(586, 20);
this.workplaceNameTextBox.TabIndex = 0;
//
// saveButton
//
this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveButton.Location = new System.Drawing.Point(348, 270);
this.saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(104, 42);
this.saveButton.TabIndex = 6;
this.saveButton.Text = "Uložiť";
this.saveButton.UseVisualStyleBackColor = true;
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Location = new System.Drawing.Point(488, 270);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 42);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Zrušiť";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.extraBatteryLifetimeTextBox);
this.groupBox4.Location = new System.Drawing.Point(12, 182);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(268, 62);
this.groupBox4.TabIndex = 3;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Predĺženie životnosti baterky v mesiacoch";
//
// extraBatteryLifetimeTextBox
//
this.extraBatteryLifetimeTextBox.Location = new System.Drawing.Point(17, 25);
this.extraBatteryLifetimeTextBox.Name = "extraBatteryLifetimeTextBox";
this.extraBatteryLifetimeTextBox.Size = new System.Drawing.Size(230, 20);
this.extraBatteryLifetimeTextBox.TabIndex = 0;
//
// oracleGroupBox
//
this.oracleGroupBox.Controls.Add(this.checkPcbIsInOracleCheckBox);
this.oracleGroupBox.Controls.Add(this.oracleBatteryCheckBox);
this.oracleGroupBox.Location = new System.Drawing.Point(297, 182);
this.oracleGroupBox.Name = "oracleGroupBox";
this.oracleGroupBox.Size = new System.Drawing.Size(337, 74);
this.oracleGroupBox.TabIndex = 5;
this.oracleGroupBox.TabStop = false;
this.oracleGroupBox.Text = "Oracle";
this.oracleGroupBox.Visible = false;
//
// checkPcbIsInOracleCheckBox
//
this.checkPcbIsInOracleCheckBox.AutoSize = true;
this.checkPcbIsInOracleCheckBox.Location = new System.Drawing.Point(18, 45);
this.checkPcbIsInOracleCheckBox.Name = "checkPcbIsInOracleCheckBox";
this.checkPcbIsInOracleCheckBox.Size = new System.Drawing.Size(213, 17);
this.checkPcbIsInOracleCheckBox.TabIndex = 0;
this.checkPcbIsInOracleCheckBox.Text = "Skontrolovať či PCB už bola overovaná";
this.checkPcbIsInOracleCheckBox.UseVisualStyleBackColor = true;
//
// oracleBatteryCheckBox
//
this.oracleBatteryCheckBox.AutoSize = true;
this.oracleBatteryCheckBox.Location = new System.Drawing.Point(18, 19);
this.oracleBatteryCheckBox.Name = "oracleBatteryCheckBox";
this.oracleBatteryCheckBox.Size = new System.Drawing.Size(193, 17);
this.oracleBatteryCheckBox.TabIndex = 0;
this.oracleBatteryCheckBox.Text = "Uložiť informácie o batérii do Oracle";
this.oracleBatteryCheckBox.UseVisualStyleBackColor = true;
//
// groupBox5
//
this.groupBox5.Controls.Add(this.usersDBConnStringTextBox);
this.groupBox5.Location = new System.Drawing.Point(12, 125);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(622, 50);
this.groupBox5.TabIndex = 2;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Connection string pre centrálnu databázu používateľov";
//
// usersDBConnStringTextBox
//
this.usersDBConnStringTextBox.Location = new System.Drawing.Point(17, 18);
this.usersDBConnStringTextBox.Name = "usersDBConnStringTextBox";
this.usersDBConnStringTextBox.Size = new System.Drawing.Size(586, 20);
this.usersDBConnStringTextBox.TabIndex = 0;
//
// SettingsDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(648, 333);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.oracleGroupBox);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.saveButton);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "SettingsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "SettingsDlg";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.oracleGroupBox.ResumeLayout(false);
this.oracleGroupBox.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox connectionStringTextBox;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox workplaceNameTextBox;
private System.Windows.Forms.Button saveButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox extraBatteryLifetimeTextBox;
private System.Windows.Forms.GroupBox oracleGroupBox;
private System.Windows.Forms.CheckBox oracleBatteryCheckBox;
private System.Windows.Forms.CheckBox checkPcbIsInOracleCheckBox;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TextBox usersDBConnStringTextBox;
}
}
+87
View File
@@ -0,0 +1,87 @@
using System;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class SettingsDlg : Form
{
public string WorkplaceName
{
set { workplaceNameTextBox.Text = value; }
get { return workplaceNameTextBox.Text; }
}
public string ConnectionString
{
set { connectionStringTextBox.Text = value; }
get { return connectionStringTextBox.Text; }
}
public string UsersDBConnString
{
set { usersDBConnStringTextBox.Text = value; }
get { return usersDBConnStringTextBox.Text; }
}
public bool OracleBattery
{
set { oracleBatteryCheckBox.Checked = value; }
get { return oracleBatteryCheckBox.Checked; }
}
public bool CheckPcbIsInOracle
{
set { checkPcbIsInOracleCheckBox.Checked = value; }
get { return checkPcbIsInOracleCheckBox.Checked; }
}
public int ExtraBatterLifetime
{
get
{
int extraLifetime;
if (int.TryParse(extraBatteryLifetimeTextBox.Text, out extraLifetime) && extraLifetime >= 0) return extraLifetime;
return 0;
}
}
public MonitoringDB.Mode Mode
{
set
{
radioButton1.Checked = (value == MonitoringDB.Mode.Test);
radioButton2.Checked = (value == MonitoringDB.Mode.Production);
}
get
{
return radioButton1.Checked ? MonitoringDB.Mode.Test : MonitoringDB.Mode.Production;
}
}
/// <summary>
/// Basic configuration dialog
/// </summary>
/// <param name="isWorkplace">false = Konfiguracia pracovisk, true = Pracovisko</param>
public SettingsDlg(bool isWorkplace)
{
InitializeComponent();
if (isWorkplace)
{
oracleGroupBox.Visible = true;
}
extraBatteryLifetimeTextBox.Text = "0";
}
private void saveButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+49
View File
@@ -0,0 +1,49 @@
using System;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class TrivialLoginDlg : Form
{
public LoginLevel LoginLevel;
public TrivialLoginDlg()
{
InitializeComponent();
LoginLevel = LoginLevel.None;
}
private void okButton_Click(object sender, EventArgs e)
{
if (passwordTextBox.Text.ToLower().Equals("barcode"))
{
LoginLevel = LoginLevel.Administrator;
DialogResult = DialogResult.OK;
Close();
}
else if (passwordTextBox.Text.ToLower().Equals("teamleader"))
{
LoginLevel = LoginLevel.TeamLeader;
DialogResult = DialogResult.OK;
Close();
}
else if (passwordTextBox.Text.ToLower().Equals("kremik"))
{
LoginLevel = LoginLevel.MH;
DialogResult = DialogResult.OK;
Close();
}
else
{
DialogResult = DialogResult.Cancel;
Close();
}
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+105
View File
@@ -0,0 +1,105 @@
namespace MonitoringDB.Forms
{
partial class TrivialLoginDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.passwordGroupBox = new System.Windows.Forms.GroupBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.passwordGroupBox.SuspendLayout();
this.SuspendLayout();
//
// passwordGroupBox
//
this.passwordGroupBox.Controls.Add(this.passwordTextBox);
this.passwordGroupBox.Location = new System.Drawing.Point(12, 10);
this.passwordGroupBox.Name = "passwordGroupBox";
this.passwordGroupBox.Size = new System.Drawing.Size(200, 49);
this.passwordGroupBox.TabIndex = 0;
this.passwordGroupBox.TabStop = false;
this.passwordGroupBox.Text = "Heslo";
//
// passwordTextBox
//
this.passwordTextBox.Location = new System.Drawing.Point(51, 18);
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.PasswordChar = '*';
this.passwordTextBox.Size = new System.Drawing.Size(100, 20);
this.passwordTextBox.TabIndex = 0;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(237, 18);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 39);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(330, 18);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 39);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// LoginDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(426, 73);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.passwordGroupBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "LoginDlg";
this.Text = "LoginDlg";
this.passwordGroupBox.ResumeLayout(false);
this.passwordGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox passwordGroupBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
}
}
+306
View File
@@ -0,0 +1,306 @@
///
/// Copyright (c) 2016-2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using MonitoringDB.Entities;
using MonitoringDB.Resources;
using NHibernate;
using NHibernate.Criterion;
namespace MonitoringDB
{
public class ItemSpec
{
///
/// Function delegate to pick a reference record and convert it to a string
///
public delegate string PrintDlgt(object x, string format, string precision, int width);
///
/// Public fields
///
public readonly ItemSpecID Uid; /// Unique Uid used to distinguish items
public readonly string Name; /// Name that can be localized to identify the item in a list
public readonly PrintDlgt PrintFn; /// Function used to convert the result to a text
public string Caption; /// User defined text printed in the column header
public string Format; /// Specifies the text generation
public string Precision; /// Specifies the text generation
public int Width; /// Specifies the text generation
readonly ItemSpecCaps itemSpecCaps;
/// <summary> Public parameterless constructor </summary>
public ItemSpec()
{
}
/// <summary> Constructor to specify all items </summary>
public ItemSpec(ItemSpecID uid, string name, PrintDlgt printFn, ItemSpecCaps itemSpecCaps)
{
Uid = uid;
Name = name;
PrintFn = printFn;
this.itemSpecCaps = itemSpecCaps;
///
Caption = name;
Format = "{0}";
Precision = string.Empty;
Width = 0;
}
/// <summary> Copy constructor </summary>
public ItemSpec Clone()
{
ItemSpec newItem = new ItemSpec(Uid, Name, PrintFn, itemSpecCaps);
newItem.Caption = Caption;
newItem.Format = Format;
newItem.Precision = Precision;
newItem.Width = Width;
return newItem;
}
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
public string Print(object x)
{
string str = PrintFn(x, Format, Precision, Width);
return (str == null) ? string.Empty : str;
}
/// <summary> Similar to Print(), in addition embeds text into "" </summary>
public string Export(object x)
{
string str = PrintFn(x, Format, Precision, Width);
if (str == null) str = string.Empty;
if (Uid == ItemSpecID.Barcode || Uid == ItemSpecID.PartBarcode || Uid == ItemSpecID.SerialNr || Uid == ItemSpecID.PurchaseOrder)
{
return string.Format("=\"{0}\"", str);
}
return str;
}
/// Static list of all available items
public static readonly IList<ItemSpec> AllItems;
///
/// Static constructor that initializes the list of all items
///
static ItemSpec()
{
AllItems = new List<ItemSpec>();
AllItems.Add(new ItemSpec(ItemSpecID.RefRecordID, Strings.RefRecordID, (x, f, p, w) => ((int)x).ToString(), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.TimeStamp, Strings.Time_stamp, (x, f, p, w) => string.IsNullOrEmpty(f) ? ((DateTime)x).ToString() : string.Format(f, (DateTime)x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.Workstep, Strings.Workstep, (x, f, p, w) => string.IsNullOrEmpty(f) ? ((Workstep)x).Name : string.Format(f, ((Workstep)x).Name), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.Workplace, Strings.Workplace, (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.UserName, Strings.User_name, (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.Barcode, Strings.Barcode, (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.PartBarcode, Strings.Part_barcode, (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord | ItemSpecCaps.AssociatedRecord));
AllItems.Add(new ItemSpec(ItemSpecID.TimeStamp2, Strings.Time_stamp+"2", (x, f, p, w) => string.IsNullOrEmpty(f) ? ((DateTime)x).ToString() : string.Format(f, (DateTime)x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.Workstep2, Strings.Workstep+"2", (x, f, p, w) => string.IsNullOrEmpty(f) ? ((Workstep)x).Name : string.Format(f, ((Workstep)x).Name), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.Workplace2, Strings.Workplace+"2", (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.UserName2, Strings.User_name+"2", (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.Barcode2, Strings.Barcode+"2", (x, f, p, w) => string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord));
AllItems.Add(new ItemSpec(ItemSpecID.PartBarcode2, Strings.Part_barcode+"2",(x, f, p, w)=> string.IsNullOrEmpty(f) ? (string)x : string.Format(f, x), ItemSpecCaps.ReferenceRecord | ItemSpecCaps.AssociatedRecord));
AllItems.Add(new ItemSpec(ItemSpecID.SerialNr, Strings.Serial_nr, (x, f, p, w) => x as string, ItemSpecCaps.ReferenceRecord | ItemSpecCaps.OracleQuery));
AllItems.Add(new ItemSpec(ItemSpecID.PurchaseOrder, Strings.Purchase_order, (x, f, p, w) => x as string, ItemSpecCaps.ReferenceRecord | ItemSpecCaps.OracleQuery));
AllItems.Add(new ItemSpec(ItemSpecID.TestResult, Strings.Test_result, (x, f, p, w) => x as string, ItemSpecCaps.ReferenceRecord | ItemSpecCaps.OracleQuery));
AllItems.Add(new ItemSpec(ItemSpecID.MaxPruefindex, Strings.Max_pruefindex, (x, f, p, w) => x as string, ItemSpecCaps.ReferenceRecord | ItemSpecCaps.OracleQuery));
AllItems.Add(new ItemSpec(ItemSpecID.Process, Strings.Process, (x, f, p, w) => string.IsNullOrEmpty(f) ? ((Process)x).Name : string.Format(f, ((Process)x).Name), ItemSpecCaps.ReferenceRecord));
}
public PropertyProjection GetProperty(ReferenceRecord refRecord, Record record)
{
switch (Uid)
{
case ItemSpecID.RefRecordID: return Projections.Property(() => refRecord.Id);
case ItemSpecID.TimeStamp: return Projections.Property(() => refRecord.TimeStamp);
case ItemSpecID.Workstep: return Projections.Property(() => refRecord.Workstep);
case ItemSpecID.Workplace: return Projections.Property(() => refRecord.Workplace);
case ItemSpecID.UserName: return Projections.Property(() => refRecord.UserName);
case ItemSpecID.Barcode: return Projections.Property(() => refRecord.Code);
case ItemSpecID.PartBarcode: return Projections.Property(() => record.Code);
case ItemSpecID.TimeStamp2: return null;
case ItemSpecID.Workstep2: return null;
case ItemSpecID.Workplace2: return null;
case ItemSpecID.UserName2: return null;
case ItemSpecID.Barcode2: return null;
case ItemSpecID.PartBarcode2: return null;
case ItemSpecID.SerialNr: return null;
case ItemSpecID.PurchaseOrder: return null;
case ItemSpecID.TestResult: return null;
case ItemSpecID.MaxPruefindex: return null;
case ItemSpecID.Process: return Projections.Property(() => refRecord.Process);
default: return null;
}
}
public PropertyProjection GetProperty2(ReferenceRecord refRecord2, Record record2)
{
switch (Uid)
{
case ItemSpecID.RefRecordID: return null;
case ItemSpecID.TimeStamp: return null;
case ItemSpecID.Workstep: return null;
case ItemSpecID.Workplace: return null;
case ItemSpecID.UserName: return null;
case ItemSpecID.Barcode: return null;
case ItemSpecID.PartBarcode: return null;
case ItemSpecID.TimeStamp2: return Projections.Property(() => refRecord2.TimeStamp);
case ItemSpecID.Workstep2: return Projections.Property(() => refRecord2.Workstep);
case ItemSpecID.Workplace2: return Projections.Property(() => refRecord2.Workplace);
case ItemSpecID.UserName2: return Projections.Property(() => refRecord2.UserName);
case ItemSpecID.Barcode2: return Projections.Property(() => refRecord2.Code);
case ItemSpecID.PartBarcode2: return Projections.Property(() => record2.Code);
case ItemSpecID.SerialNr: return null;
case ItemSpecID.PurchaseOrder: return null;
case ItemSpecID.TestResult: return null;
case ItemSpecID.MaxPruefindex: return null;
case ItemSpecID.Process: return Projections.Property(() => refRecord2.Process);
default: return null;
}
}
public ItemSpecCaps GetCaps()
{
return itemSpecCaps;
}
public static ItemSpec GetItem(ItemSpecID id)
{
foreach (var item in AllItems)
if (item.Uid == id)
return item.Clone();
return null;
}
public static ItemSpec GetItem(string uidName)
{
foreach (var item in AllItems)
if (item.Uid.ToString() == uidName)
return item.Clone();
return null;
}
public static ProjectionList GetProjections(IList<ItemSpec> items, ReferenceRecord refRecord, Record record)
{
ProjectionList projections = Projections.ProjectionList();
foreach (var item in items)
{
PropertyProjection projection = item.GetProperty(refRecord, record);
if (projection != null)
projections.Add(projection);
}
return projections;
}
public static IList<object[]> Expand(IList<object[]> data, IList<ItemSpec> items)
{
if (data.Count == 0) return data;
int iSize = data[0].Length;
int oSize = items.Count;
for (int i = 0; i < data.Count; i++)
{
object[] inArr = data[i];
object[] outArr = new object[oSize];
int srcIx = 0;
for (int dstIx = 0; dstIx < oSize; dstIx++)
{
outArr[dstIx] = ((items[dstIx].GetCaps() & ItemSpecCaps.OracleQuery) == ItemSpecCaps.OracleQuery) ? string.Empty : inArr[srcIx++];
}
data[i] = outArr;
}
return data;
}
//static string GetPartCode(ReferenceRecord refRecord, string partName)
//{
// if (refRecord != null && refRecord.Records != null)
// {
// foreach (var record in refRecord.Records)
// {
// if (record.Part.Name.Equals(partName))
// {
// return record.Code;
// }
// }
// }
// return string.Empty;
//}
public static string[] ToStrArray(IList<ItemSpec> items)
{
int count = (items != null) ? items.Count : 0;
string[] result = new string[count];
for (int i = 0; i < count; i++)
{
result[i] = string.Format("{0}~{1}~{2}~{3}~{4}",
items[i].Uid,
items[i].Caption,
items[i].Format,
items[i].Precision,
items[i].Width);
}
return result;
}
public static IList<ItemSpec> FromStrArray(string[] strArray)
{
IList<ItemSpec> result = new List<ItemSpec>();
if (strArray != null)
{
for (int i = 0; i < strArray.Length; i++)
{
string[] field = strArray[i].Split(new char[] { '~' });
try
{
ItemSpec item = GetItem(field[0]);
item.Caption = field[1];
item.Format = field[2];
item.Precision = field[3];
item.Width = int.Parse(field[4]);
result.Add(item);
}
catch
{
ItemSpec item = GetItem(ItemSpecID.RefRecordID);
item.Format = string.Format("Parse error: {0}", strArray[i]);
result.Add(item);
}
}
}
return result;
}
}
}
+23
View File
@@ -0,0 +1,23 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class PartMap : ClassMap<Entities.Part>
{
public PartMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.OraDBType);
Map(x => x.Description);
Map(x => x.CodeType);
Map(x => x.CodeForm);
Map(x => x.CodeLocation);
Map(x => x.LifetimeManagement);
Map(x => x.StepNumber);
References(x => x.Process);
References(x => x.Workstep);
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class ProcessMap : ClassMap<Entities.Process>
{
public ProcessMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.ReleaseStatus);
Map(x => x.TimeStamp);
Map(x => x.UserName);
HasMany(x => x.Parts)
.OrderBy("Name")
.Cascade.All();
HasMany(x => x.Worksteps)
.OrderBy("WorkstepNr")
.Cascade.All();
}
}
}
+17
View File
@@ -0,0 +1,17 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class RecordMap : ClassMap<Entities.Record>
{
public RecordMap()
{
Id(x => x.Id);
Map(x => x.Code);
Map(x => x.TimeStamp);
References(x => x.Part);
References(x => x.ReferenceRecord);
}
}
}
@@ -0,0 +1,22 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class ReferenceRecordMap : ClassMap<Entities.ReferenceRecord>
{
public ReferenceRecordMap()
{
Id(x => x.Id);
Map(x => x.Code);
Map(x => x.TimeStamp);
Map(x => x.UserName);
Map(x => x.Workplace);
Map(x => x.Result);
References(x => x.Process);
References(x => x.Workstep);
HasMany(x => x.Records)
.Cascade.All();
}
}
}
+23
View File
@@ -0,0 +1,23 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class WorkstepMap : ClassMap<Entities.Workstep>
{
public WorkstepMap()
{
Id(x => x.Id);
Map(x => x.WorkstepNr);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.CheckPartNr);
Map(x => x.AllowRepairs);
References(x => x.Process);
References(x => x.ReferencePart);
HasMany(x => x.Parts)
.OrderBy("StepNumber")
.Cascade.All();
}
}
}
+157
View File
@@ -0,0 +1,157 @@
<?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>{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MonitoringDB</RootNamespace>
<AssemblyName>MonitoringDB</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\ListViewEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\TrivialLoginDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\TrivialLoginDlg.designer.cs">
<DependentUpon>TrivialLoginDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ModelessForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ModelessForm.designer.cs">
<DependentUpon>ModelessForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ResultsConfigDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ResultsConfigDlg.designer.cs">
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SettingsDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsDlg.designer.cs">
<DependentUpon>SettingsDlg.cs</DependentUpon>
</Compile>
<Compile Include="ItemSpec.cs" />
<Compile Include="QuitAppException.cs" />
<Compile Include="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="ScanVerificationInfo.cs" />
<Compile Include="SerializableDictionary.cs" />
<Compile Include="WMPart.cs" />
<Compile Include="Entities\Part.cs" />
<Compile Include="Entities\Process.cs" />
<Compile Include="Entities\Record.cs" />
<Compile Include="Entities\ReferenceRecord.cs" />
<Compile Include="Entities\Workstep.cs" />
<Compile Include="Enums.cs" />
<Compile Include="FluentNH.cs" />
<Compile Include="Mappings\PartMap.cs" />
<Compile Include="Mappings\ProcessMap.cs" />
<Compile Include="Mappings\RecordMap.cs" />
<Compile Include="Mappings\ReferenceRecordMap.cs" />
<Compile Include="Mappings\WorkstepMap.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\ListViewEx.resx">
<DependentUpon>ListViewEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\TrivialLoginDlg.resx">
<DependentUpon>TrivialLoginDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ModelessForm.resx">
<DependentUpon>ModelessForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ResultsConfigDlg.resx">
<DependentUpon>ResultsConfigDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SettingsDlg.resx">
<DependentUpon>SettingsDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</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>
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Common")]
[assembly: AssemblyCopyright("Copyright © 2015-2017")]
[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("b182c80f-8670-40ab-ad26-6fb8de86552e")]
// 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.5.57.0")]
[assembly: AssemblyFileVersion("1.5.57.0")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MonitoringDB.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitoringDB.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+12
View File
@@ -0,0 +1,12 @@
using System;
namespace MonitoringDB
{
public class QuitAppException : Exception
{
public QuitAppException(string message)
: base(message)
{
}
}
}
+333
View File
@@ -0,0 +1,333 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MonitoringDB.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Strings {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Strings() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitoringDB.Resources.Strings", typeof(Strings).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Add &gt;.
/// </summary>
internal static string Add {
get {
return ResourceManager.GetString("Add", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Available results.
/// </summary>
internal static string Available_results {
get {
return ResourceManager.GetString("Available_results", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Barcode.
/// </summary>
internal static string Barcode {
get {
return ResourceManager.GetString("Barcode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
internal static string CancelBtnText {
get {
return ResourceManager.GetString("CancelBtnText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Caption.
/// </summary>
internal static string Caption {
get {
return ResourceManager.GetString("Caption", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configuration.
/// </summary>
internal static string Configuration {
get {
return ResourceManager.GetString("Configuration", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Down.
/// </summary>
internal static string DownBtnText {
get {
return ResourceManager.GetString("DownBtnText", resourceCulture);
}
}
/// <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 Item.
/// </summary>
internal static string Item {
get {
return ResourceManager.GetString("Item", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Max. prüfindex.
/// </summary>
internal static string Max_pruefindex {
get {
return ResourceManager.GetString("Max_pruefindex", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
internal static string OkBtnText {
get {
return ResourceManager.GetString("OkBtnText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Another part barcode.
/// </summary>
internal static string Part_barcode {
get {
return ResourceManager.GetString("Part_barcode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Precision.
/// </summary>
internal static string Precision {
get {
return ResourceManager.GetString("Precision", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Process.
/// </summary>
internal static string Process {
get {
return ResourceManager.GetString("Process", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Purchase order.
/// </summary>
internal static string Purchase_order {
get {
return ResourceManager.GetString("Purchase_order", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Record ID.
/// </summary>
internal static string RefRecordID {
get {
return ResourceManager.GetString("RefRecordID", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt; Remove.
/// </summary>
internal static string Remove {
get {
return ResourceManager.GetString("Remove", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove all.
/// </summary>
internal static string Remove_all {
get {
return ResourceManager.GetString("Remove_all", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Selected results.
/// </summary>
internal static string Selected_results {
get {
return ResourceManager.GetString("Selected_results", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial nr..
/// </summary>
internal static string Serial_nr {
get {
return ResourceManager.GetString("Serial_nr", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Serial_number.
/// </summary>
internal static string Serial_number {
get {
return ResourceManager.GetString("Serial_number", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Summary.
/// </summary>
internal static string Summary {
get {
return ResourceManager.GetString("Summary", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Test result.
/// </summary>
internal static string Test_result {
get {
return ResourceManager.GetString("Test_result", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Text.
/// </summary>
internal static string Text {
get {
return ResourceManager.GetString("Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time stamp.
/// </summary>
internal static string Time_stamp {
get {
return ResourceManager.GetString("Time_stamp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Up.
/// </summary>
internal static string UpBtnText {
get {
return ResourceManager.GetString("UpBtnText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to User name.
/// </summary>
internal static string User_name {
get {
return ResourceManager.GetString("User_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Width.
/// </summary>
internal static string Width {
get {
return ResourceManager.GetString("Width", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Workplace.
/// </summary>
internal static string Workplace {
get {
return ResourceManager.GetString("Workplace", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Workstep.
/// </summary>
internal static string Workstep {
get {
return ResourceManager.GetString("Workstep", resourceCulture);
}
}
}
}
+210
View File
@@ -0,0 +1,210 @@
<?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>Add &gt;</value>
</data>
<data name="Available_results" xml:space="preserve">
<value>Available results</value>
</data>
<data name="Barcode" xml:space="preserve">
<value>Barcode</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Caption" xml:space="preserve">
<value>Caption</value>
</data>
<data name="Configuration" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="DownBtnText" xml:space="preserve">
<value>Down</value>
</data>
<data name="Format" xml:space="preserve">
<value>Format</value>
</data>
<data name="Item" xml:space="preserve">
<value>Item</value>
</data>
<data name="Max_pruefindex" xml:space="preserve">
<value>Max. prüfindex</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>OK</value>
</data>
<data name="Part_barcode" xml:space="preserve">
<value>Another part barcode</value>
</data>
<data name="Precision" xml:space="preserve">
<value>Precision</value>
</data>
<data name="Process" xml:space="preserve">
<value>Process</value>
</data>
<data name="Purchase_order" xml:space="preserve">
<value>Purchase order</value>
</data>
<data name="RefRecordID" xml:space="preserve">
<value>Record ID</value>
</data>
<data name="Remove" xml:space="preserve">
<value>&lt; Remove</value>
</data>
<data name="Remove_all" xml:space="preserve">
<value>Remove all</value>
</data>
<data name="Selected_results" xml:space="preserve">
<value>Selected results</value>
</data>
<data name="Serial_nr" xml:space="preserve">
<value>Serial nr.</value>
</data>
<data name="Serial_number" xml:space="preserve">
<value>Serial_number</value>
</data>
<data name="Summary" xml:space="preserve">
<value>Summary</value>
</data>
<data name="Test_result" xml:space="preserve">
<value>Test result</value>
</data>
<data name="Text" xml:space="preserve">
<value>Text</value>
</data>
<data name="Time_stamp" xml:space="preserve">
<value>Time stamp</value>
</data>
<data name="UpBtnText" xml:space="preserve">
<value>Up</value>
</data>
<data name="User_name" xml:space="preserve">
<value>User name</value>
</data>
<data name="Width" xml:space="preserve">
<value>Width</value>
</data>
<data name="Workplace" xml:space="preserve">
<value>Workplace</value>
</data>
<data name="Workstep" xml:space="preserve">
<value>Workstep</value>
</data>
</root>
+25
View File
@@ -0,0 +1,25 @@
using MonitoringDB.Entities;
namespace MonitoringDB
{
public class ScanVerificationInfo
{
public Workstep Workstep; /// null = verification is disabled
public bool VerifyReferencePart; /// true = verify current workstep ReferencePart with another part
/// false = verify Part from current workstep parts with ReferencePart of another Workstep
public Part Part; /// Applicable when VerifyReferencePart == false
/// Constructor that disables verification
public ScanVerificationInfo()
{
Workstep = null;
}
public ScanVerificationInfo(Workstep workstep, bool verifyReferencePart, Part part)
{
Workstep = workstep;
VerifyReferencePart = verifyReferencePart;
Part = part;
}
}
}
+69
View File
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace MonitoringDB
{
[XmlRoot("dictionary")]
public class SerializableDictionary<TKey, TValue>
: Dictionary<TKey, TValue>, IXmlSerializable
{
public System.Xml.Schema.XmlSchema GetSchema()
{
return null;
}
public void ReadXml(System.Xml.XmlReader reader)
{
XmlSerializer keySerializer = new XmlSerializer(typeof(TKey));
XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));
bool wasEmpty = reader.IsEmptyElement;
reader.Read();
if (wasEmpty)
return;
while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
{
reader.ReadStartElement("item");
reader.ReadStartElement("key");
TKey key = (TKey)keySerializer.Deserialize(reader);
reader.ReadEndElement();
reader.ReadStartElement("value");
TValue value = (TValue)valueSerializer.Deserialize(reader);
reader.ReadEndElement();
this.Add(key, value);
reader.ReadEndElement();
reader.MoveToContent();
}
reader.ReadEndElement();
}
public void WriteXml(System.Xml.XmlWriter writer)
{
XmlSerializer keySerializer = new XmlSerializer(typeof(TKey));
XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));
foreach (TKey key in this.Keys)
{
writer.WriteStartElement("item");
writer.WriteStartElement("key");
keySerializer.Serialize(writer, key);
writer.WriteEndElement();
writer.WriteStartElement("value");
TValue value = this[key];
valueSerializer.Serialize(writer, value);
writer.WriteEndElement();
writer.WriteEndElement();
}
}
}
}
+53
View File
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonitoringDB.Entities;
namespace MonitoringDB
{
public class WMPart
{
public string Name;
public Process Process;
public string OraDBType;
public string Description;
public string Code;
public DateTime TimeStamp;
public CodeType CodeType;
public CodeForm CodeForm;
public CodeLocation CodeLocation;
public string UserName;
public string Workplace;
public WMPart(ReferenceRecord rr)
{
Name = rr.Workstep.ReferencePart.Name;
Process = rr.Process;
OraDBType = rr.Workstep.ReferencePart.OraDBType;
Description = rr.Workstep.ReferencePart.Description;
Code = rr.Code;
TimeStamp = rr.TimeStamp;
CodeType = rr.Workstep.ReferencePart.CodeType;
CodeForm = rr.Workstep.ReferencePart.CodeForm;
CodeLocation = rr.Workstep.ReferencePart.CodeLocation;
UserName = rr.UserName;
Workplace = rr.Workplace;
}
public WMPart(Record r)
{
Name = r.Part.Name;
Process = r.Part.Process;
OraDBType = r.Part.OraDBType;
Description = r.Part.Description;
Code = r.Code;
TimeStamp = r.TimeStamp;
CodeType = r.Part.CodeType;
CodeForm = r.Part.CodeForm;
CodeLocation = r.Part.CodeLocation;
UserName = r.ReferenceRecord.UserName;
Workplace = r.ReferenceRecord.Workplace;
}
}
}
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Iesi.Collections" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net40" />
<package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40" />
<package id="NHibernate" version="4.0.4.4000" targetFramework="net40" />
</packages>
+20 -2
View File
@@ -29,7 +29,7 @@ namespace Results
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
Config.Entities.Procedure procedure,
WaterMeterData[] waterMeterDatas, int[] waterMeterParts)
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
{
BatchResults d = new BatchResults(waterMeterDatas.Length);
int year = DateTime.Now.Year;
@@ -46,8 +46,9 @@ namespace Results
ProcedureDescription = procedure.Description,
WatermetersStr = procedure.Watermeters,
ProcedureRevision = procedure.Revision,
ProtocolTitle = procedure.ProtocolTitle,
ProtocolTitle = string.Empty,
StartTime = DateTime.Now,
DensityCorr = (float)densityCorr,
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
#if HEAT_METERS
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter),
@@ -188,5 +189,22 @@ namespace Results
}
}
}
public bool IsProduction()
{
for (int i = 0; i < WMPositionsCount; i++)
{
if (WaterMeters[i] != null)
{
foreach (var mtr in WaterMeters[i].MeterTestRslts)
{
if (mtr.TestData().Name.ToLower().Contains("adj"))
return true;
}
}
}
return false;
}
}
}
+56 -2
View File
@@ -21,12 +21,19 @@ namespace Results
public static ISessionFactory SessionFactory;
/// <summary> Connection string for all sessions </summary>
private static string connectionString;
static string connectionString;
///
public static string ConnectionString
{
get { return connectionString; }
set { connectionString = value; SessionFactory = null; }
set
{
if (value != connectionString)
{
connectionString = value;
SessionFactory = null; /// Clear SessionFactory on connection string change
}
}
}
/// <summary> Database type (MySQL or SQLite) for all sessions </summary>
@@ -254,6 +261,12 @@ namespace Results
foreach (var cd in ComponentsList) if (cd.Id == 0) session.SaveOrUpdate(cd);
foreach (var wd in WaterMeterDataList) if (wd.Id == 0) session.SaveOrUpdate(wd);
log.Debug(batch.ToString(1));
foreach (var tstRslt in batch.TestRslts)
{
log.Debug(tstRslt.ToString(1));
}
session.SaveOrUpdate(batch);
transaction.Commit();
@@ -261,7 +274,13 @@ namespace Results
catch (Exception exc)
{
transaction.Rollback();
log.FatalFormat("Saving results of batch #{0} into the results DB failed: {1}", batch.BatchNr, exc.Message);
if (exc.InnerException != null && !string.IsNullOrEmpty(exc.InnerException.Message))
{
log.FatalFormat("Inner exception message: {0}", exc.InnerException.Message);
}
return false;
}
@@ -270,5 +289,40 @@ namespace Results
return true;
}
public static Batch LoadBatch(int batchNr)
{
IList<Batch> batches;
ISession session = DB.CreateSession();
if (session == null) return null;
TestDataList = session.QueryOver<TestData>().List();
ComponentsList = session.QueryOver<Components>().List();
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
try
{
batches = session.QueryOver<Batch>()
.Where(x => (x.BatchNr == batchNr))
.List();
foreach (var batch in batches)
{
batch.TestRslts = session.QueryOver<TestRslt>()
.Where(x => (x.Batch.Id == batch.Id))
.List();
batch.WaterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch.Id == batch.Id))
.List();
}
}
catch (Exception exc)
{
log.FatalFormat("Cannot load batch #{0}: {1}", batchNr, exc.Message);
return null;
}
return (batches.Count > 0) ? batches[0] : null;
}
}
}
+63
View File
@@ -0,0 +1,63 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using log4net;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using Results.Entities;
namespace Results
{
public class DBase
{
static readonly ILog log = LogManager.GetLogger(typeof(DBase));
/// <summary> Session factory for all regular sessions, not for CreateEmptyResultsDB(). </summary>
public static IList<DBase> Databases;
public static int Count { get { return Databases.Count; } }
static DBase()
{
Databases = new List<DBase>();
}
public readonly string Name;
public readonly string ConnectionString;
ISessionFactory sessionFactory;
public DBase(string connectionString, string name)
{
this.ConnectionString = connectionString;
this.Name = name;
sessionFactory = Fluently.Configure()
.Database(MySQLConfiguration.Standard.ConnectionString(connectionString))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.WaterMeterData>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
}
public DBase(string connectionString)
: this(connectionString, string.Empty)
{
}
private void BuildSchema(Configuration config)
{
/// This NHibernate tool takes a configuration with mapping info and exports a database schema
new SchemaExport(config).SetOutputFile("db_schema");
}
public ISession OpenSession()
{
return sessionFactory.OpenSession();
}
}
}
+148 -22
View File
@@ -20,12 +20,13 @@ namespace Results.Entities
public virtual string WatermetersStr { get; set; } /// CEVAK, not mapped to DB
public virtual string ProtocolTitle { get; set; }
public virtual string Remark { get; set; }
public virtual float Custom1 { get; set; }
public virtual float DensityCorr { get; set; } /// Density correction in [kg/m3]
public virtual float Custom2 { get; set; }
public virtual float Custom3 { get; set; }
public virtual DateTime StartTime { get; set; }
public virtual DateTime EndTime { get; set; }
public virtual bool RsltsSent { get; set; }
public virtual bool Dirty { get; set; }
public virtual bool RsltsSent { get; set; }
public virtual bool RsltsPrinted { get; set; }
public virtual IList<TestData> Tests { get; set; }
public virtual IList<WaterMeter> WaterMeters { get; set; }
@@ -40,29 +41,145 @@ namespace Results.Entities
TestRslts = new List<TestRslt>();
}
public virtual float AmbientTempAve()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbTempMean;
return sum / TestRslts.Count;
}
public virtual int PassedMetersCount()
{
int count = 0;
foreach (var mtr in WaterMeters) if (mtr.PassedFromTests()) count++;
return count;
}
public virtual float AmbientPressAve()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbPressMean;
return sum / TestRslts.Count;
}
public virtual int FailedMetersCount()
{
return WaterMeters.Count - PassedMetersCount();
}
public virtual float AmbientHumiAve()
public virtual double AmbTempMean()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbHumiMean;
return sum / TestRslts.Count;
}
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.AmbTempMean * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbPressMean()
{
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.AmbPressMean * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbHumiMean()
{
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.AmbHumiMean * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual double AmbTempStart()
{
for (int i = 0; i < TestRslts.Count; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbTempStart;
}
return 0;
}
public virtual double AmbPressStart()
{
for (int i = 0; i < TestRslts.Count; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbPressStart;
}
return 0;
}
public virtual double AmbHumiStart()
{
for (int i = 0; i < TestRslts.Count; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbHumiStart;
}
return 0;
}
public virtual double AmbTempEnd()
{
for (int i = TestRslts.Count - 1; i >= 0; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbTempEnd;
}
return 0;
}
public virtual double AmbPressEnd()
{
for (int i = TestRslts.Count - 1; i >= 0; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbPressEnd;
}
return 0;
}
public virtual double AmbHumiEnd()
{
for (int i = TestRslts.Count - 1; i >= 0; i++)
{
if (TestRslts[i].Publish() == Config.Entities.Publish.Always)
return TestRslts[i].AmbHumiEnd;
}
return 0;
}
public virtual double Buoyancy()
{
double timeSum = 0;
double sum = 0;
foreach (var tr in TestRslts)
{
if (tr.TestData.Evaluate && tr.TestDone)
{
double duration = (tr.EndTime - tr.StartTime).TotalSeconds;
timeSum += duration;
sum += (tr.Buoyancy * duration);
}
}
return (timeSum == 0) ? 0 : (sum / timeSum);
}
public virtual TestRslt GetTestRslt(string name, int part)
{
@@ -77,5 +194,14 @@ namespace Results.Entities
{
return string.Format("Batch #{0}, Start:{1}, End:{2}, Procedure:{3}", BatchNr, StartTime, EndTime, ProcedureName);
}
public virtual string ToString(int i)
{
return string.Format("Batch: BatchNr={0} TestBenchId={1} ProgramVersion={2} UserName={3} UserNumber={4} ProcedureName={5} ProcedureRevision={6} ProtocolTitle={7} Remark={8} DensityCorr={9} Custom2={10} Custom3={11} StartTime={12} EndTime={13} Dirty={14} RsltsSent={15} RsltsPrinted={16}",
BatchNr, TestBenchId, ProgramVersion, UserName, UserNumber,
ProcedureName, ProcedureRevision, ProtocolTitle, Remark, DensityCorr,
Custom2, Custom3, StartTime, EndTime, Dirty,
RsltsSent, RsltsPrinted);
}
}
}
+35 -8
View File
@@ -23,6 +23,7 @@ namespace Results.Entities
/// Main result
public virtual double Error { get; set; } /// [%]
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
public virtual bool TestDone { get; set; } /// true = test was completed
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
@@ -40,7 +41,7 @@ namespace Results.Entities
public virtual double DensityOut() { return TestRslt.DensityOut; }
public virtual Components Components(){ return TestRslt.Components; }
///
protected virtual TestData TestData() { return TestRslt.TestData; }
public virtual TestData TestData() { return TestRslt.TestData; }
///
public virtual int Repeats() { return TestData().Repeats; }
public virtual double Qfrom() { return TestData().Qfrom; } /// [m3/h]
@@ -65,15 +66,16 @@ namespace Results.Entities
public virtual WaterMeterData WaterMeterData() { return WaterMeter.WaterMeterData; }
public virtual Batch Batch() { return WaterMeter.Batch; }
public virtual bool IsPilotRslt()
{
return (CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Single) ||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Compound) ||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy);
}
public virtual string PassedColorStr()
{
#if PUCHONG_PT200
if (!Evaluate()) return Passed ? "OK|White" : "NG|White";
else return Passed ? "OK|Green" : "NG|Red";
#else
if (!Evaluate()) return Passed ? "OK|White" : "NOK|White";
else return Passed ? "OK|Green" : "NOK|Red";
#endif
return Utils.PassedColorStr(Passed, Evaluate());
}
public MeterTestRslt()
@@ -89,5 +91,30 @@ namespace Results.Entities
TestRslt = testRslt;
CompoundMeterId = (byte)compoundMeterId;
}
public virtual void CopyContentFrom(MeterTestRslt src)
{
if (src == null) return;
PulsesMeter = src.PulsesMeter;
PulsesMaster = src.PulsesMaster;
PulsesPerLiter = src.PulsesPerLiter;
VolumeStart = src.VolumeStart;
VolumeEnd = src.VolumeEnd;
VolumeMeter = src.VolumeMeter;
VolumeRef = src.VolumeRef;
TimestampStart = src.TimestampStart;
TimestampEnd = src.TimestampEnd;
TestTime = src.TestTime;
Error = src.Error;
KorrErrQ = src.KorrErrQ;
TestDone = src.TestDone;
Passed = src.Passed;
}
public override string ToString()
{
return (TestRslt != null) ? Name() : base.ToString();
}
}
}
+36 -24
View File
@@ -12,19 +12,22 @@ namespace Results.Entities
/// </summary>
public class TestData
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int Repeats { get; set; }
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qto { get; set; } /// [m3/h] flow range high limit
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int Repeats { get; set; }
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qto { get; set; } /// [m3/h] flow range high limit
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
protected TestData()
@@ -36,18 +39,21 @@ namespace Results.Entities
public TestData(Config.Entities.Test test)
: this()
{
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TstTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
Uncertainty = (double)test.Uncertainty;
Publish = test.Publish;
Evaluate = test.Evaluate;
TargetTime = (double)test.TstTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
Uncertainty = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
}
@@ -68,6 +74,12 @@ namespace Results.Entities
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (Uncertainty != td.Uncertainty) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
}
if (Publish != td.Publish) return false;
if (Evaluate != td.Evaluate) return false;
+207 -13
View File
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Text;
namespace Results.Entities
{
@@ -14,12 +15,14 @@ namespace Results.Entities
public virtual TestData TestData { get; set; }
public virtual Components Components { get; set; }
public virtual int Part { get; set; }
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
/// Main results
public virtual bool TestDone { get; set; }
public virtual string Remark { get; set; }
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; }
public virtual double ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
@@ -37,6 +40,19 @@ namespace Results.Entities
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%]
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
public virtual float DivStart50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
public virtual float DivStart90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
public virtual float DiverterEnd { get; set; } /// [s] Diverter switch time when test ends
public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB)
public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB)
public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
public virtual int ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
public virtual sbyte ErrorFlagsMd { get; set; } /// 0=off, 1=info, 2=on (evaluated in MeterTestRslt.Passed)
/// Main results of heat meters
public virtual double RefEnergy { get; set; } /// [J] Joul
@@ -86,13 +102,14 @@ namespace Results.Entities
public virtual float TempDivEnd { get; set; } /// [°C]
public virtual float TempDivMin { get; set; } /// [°C]
public virtual float TempDivMax { get; set; } /// [°C]
public virtual float FlowStart { get; set; } /// [m3/h] minimum flow
public virtual float FlowEnd { get; set; } /// [m3/h] maximum flow
public virtual float FlowMin { get; set; } /// [m3/h] minimum flow
public virtual float FlowMax { get; set; } /// [m3/h] maximum flow
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
public virtual float Custom2 { get; set; } /// [°C] T ref hi start
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
@@ -104,16 +121,65 @@ namespace Results.Entities
/// Wrappers
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
public virtual int Repeats() { return TestData.Repeats; }
public virtual int Repeats() { return TestData.Repeats; }
public virtual double Qfrom() { return TestData.Qfrom; }
public virtual double Qto() { return TestData.Qto; }
public virtual double TargetVolume() { return TestData.TargetVolume; }
public virtual double TargetTime() { return TestData.TargetTime; }
public virtual string Method() { return TestData.Method; }
public virtual double ErrLimLo() { return TestData.ErrLimLo; }
public virtual double ErrLimHi() { return TestData.ErrLimHi; }
public virtual double ErrLimLo()
{
if (TestData.ErrLimLo <= TestData.ErrLimHi)
{
return TestData.ErrLimLo; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(TestData.ErrLimLo);
double Qp = Math.Abs(TestData.ErrLimHi);
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return -Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return -Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual double ErrLimHi()
{
if (TestData.ErrLimLo <= TestData.ErrLimHi)
{
return TestData.ErrLimHi; /// Error limit of a water meter
}
else
{
/// Metrological class and nominal flow of a heat meter
int metrClass = (int)Math.Round(TestData.ErrLimLo);
double Qp = Math.Abs(TestData.ErrLimHi);
double Q = Math.Max(FlowMean, 0.00001); /// to avoid division by zero
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return +Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return +Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual double Uncertainty() { return TestData.Uncertainty; }
public virtual bool Evaluate() { return TestData.Evaluate; }
public virtual float TempLimLo() { return TestData.TempLimLo; }
public virtual float TempLimHi() { return TestData.TempLimHi; }
public virtual bool Evaluate() { return TestData.Evaluate; }
public virtual Config.Entities.Publish Publish() { return (Config.Entities.Publish)TestData.Publish; }
@@ -130,9 +196,137 @@ namespace Results.Entities
RepetitionNr = repetitionNr;
}
public virtual void CopyContentFrom(TestRslt src)
{
if (src == null) return;
Components = src.Components; /// ???
Part = src.Part;
RepetitionNr = src.RepetitionNr;
TestDone = src.TestDone;
Remark = src.Remark;
StartTime = src.StartTime;
EndTime = src.EndTime;
FlowSetTime = src.FlowSetTime;
TestTime = src.TestTime;
PulsesMaster = src.PulsesMaster;
ConstMaster = src.ConstMaster;
MassStartRaw = src.MassStartRaw;
MassStart = src.MassStart;
MassEndRaw = src.MassEndRaw;
MassEnd = src.MassEnd;
DensityIn = src.DensityIn;
DensityOut = src.DensityOut;
DensityDiv = src.DensityDiv;
Buoyancy = src.Buoyancy;
FlowMass = src.FlowMass;
FlowVolume = src.FlowVolume;
VolumeCTV = src.VolumeCTV;
VolumeMaster = src.VolumeMaster;
ErrorMaster = src.ErrorMaster;
DiverterStart = src.DiverterStart;
DiverterEnd = src.DiverterEnd;
ErrorFlags = src.ErrorFlags;
ErrorFlagsMd = src.ErrorFlagsMd;
RefEnergy = src.RefEnergy;
AmbTempMean = src.AmbTempMean;
AmbTempStart = src.AmbTempStart;
AmbTempEnd = src.AmbTempEnd;
AmbTempMin = src.AmbTempMin;
AmbTempMax = src.AmbTempMax;
AmbPressMean = src.AmbPressMean;
AmbPressStart = src.AmbPressStart;
AmbPressEnd = src.AmbPressEnd;
AmbPressMin = src.AmbPressMin;
AmbPressMax = src.AmbPressMax;
AmbHumiMean = src.AmbHumiMean;
AmbHumiStart = src.AmbHumiStart;
AmbHumiEnd = src.AmbHumiEnd;
AmbHumiMin = src.AmbHumiMin;
AmbHumiMax = src.AmbHumiMax;
PressUpMean = src.PressUpMean;
PressUpStart = src.PressUpStart;
PressUpEnd = src.PressUpEnd;
PressUpMin = src.PressUpMin;
PressUpMax = src.PressUpMax;
PressDownMean = src.PressDownMean;
PressDownStart = src.PressDownStart;
PressDownEnd = src.PressDownEnd;
PressDownMin = src.PressDownMin;
PressDownMax = src.PressDownMax;
PressDeltaMean = src.PressDeltaMean;
PressDeltaStart = src.PressDeltaStart;
PressDeltaEnd = src.PressDeltaEnd;
PressDeltaMin = src.PressDeltaMin;
PressDeltaMax = src.PressDeltaMax;
TempUpMean = src.TempUpMean;
TempUpStart = src.TempUpStart;
TempUpEnd = src.TempUpEnd;
TempUpMin = src.TempUpMin;
TempUpMax = src.TempUpMax;
TempDownMean = src.TempDownMean;
TempDownStart = src.TempDownStart;
TempDownEnd = src.TempDownEnd;
TempDownMin = src.TempDownMin;
TempDownMax = src.TempDownMax;
TempDivMean = src.TempDivMean;
TempDivStart = src.TempDivStart;
TempDivEnd = src.TempDivEnd;
TempDivMin = src.TempDivMin;
TempDivMax = src.TempDivMax;
FlowMean = src.FlowMean;
FlowStart = src.FlowStart;
FlowEnd = src.FlowEnd;
FlowMin = src.FlowMin;
FlowMax = src.FlowMax;
Custom1 = src.Custom1;
Custom2 = src.Custom2;
Custom3 = src.Custom3;
Custom4 = src.Custom4;
Custom5 = src.Custom5;
Custom6 = src.Custom6;
Custom7 = src.Custom7;
Custom8 = src.Custom8;
Custom9 = src.Custom9;
Custom10 = src.Custom10;
}
/// <summary> Wrapper </summary>
public virtual Config.Entities.ErrorFlagsMode ErrorFlagsMode()
{
return (Config.Entities.ErrorFlagsMode)ErrorFlagsMd;
}
/// <summary> Wrapper </summary>
public virtual string ErrorFlagsStr()
{
return Utils.ErrorFlagsStr(ErrorFlags);
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
}
}
public virtual string ToString(int i)
{
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} Buoyancy={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} ErrorFlagsMd={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
DensityIn, DensityOut, DensityDiv, Buoyancy, FlowMass, FlowVolume,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, ErrorFlagsMd,
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
AmbHumiMean, AmbHumiStart, AmbHumiEnd, AmbHumiMin, AmbHumiMax,
PressUpMean, PressUpStart, PressUpEnd, PressUpMin, PressUpMax,
PressDownMean, PressDownStart, PressDownEnd, PressDownMin, PressDownMax,
PressDeltaMean, PressDeltaStart, PressDeltaEnd, PressDeltaMin, PressDeltaMax,
TempUpMean, TempUpStart, TempUpEnd, TempUpMin, TempUpMax,
TempDownMean, TempDownStart, TempDownEnd, TempDownMin, TempDownMax,
TempDivMean, TempDivStart, TempDivEnd, TempDivMin, TempDivMax,
FlowMean, FlowStart, FlowEnd, FlowMin, FlowMax,
Custom1, Custom2, Custom3, Custom4, Custom5, Custom6, Custom7, Custom8, Custom9, Custom10,
DiverterStart, DiverterEnd);
}
}
}

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