Compare commits

...
Author SHA1 Message Date
Milan Hanajik 003862a109 Fixes for #if IPERL related to recent uncertainty/error flags changes, ver. 2.24.1391 2020-01-10 11:33:37 +01:00
Milan Hanajik 771758892b Solution upgraded to VS2012 2020-01-07 11:09:52 +01:00
Milan Hanajik 42dfbeab2f Testmethods.ManualEntry : (1) UI (yes/no, last values are stored, etc.), (2) PMax pressure and test time fixed, ver. 2.24.1390 2020-01-07 11:05:31 +01:00
Milan Hanajik 6678cb31c5 TestMethods.ManualEntry, Results.ManualEntryItemSpec, Results.Forms.ManualEntryConfig..., etc., ver. 2.24.1389 2019-12-22 11:51:54 +01:00
Milan Hanajik 94b9f564cc Output.DB.ProductionTracing : Alternative profuction tracing DB possible. 2019-12-18 17:53:12 +01:00
Milan Hanajik 4bf4445672 RestoreAndFixBatch functionality modified. 2019-12-18 17:52:46 +01:00
Milan Hanajik b4763441a8 (1) Bug fix in sending FM pump frequencies to control board, (2) More logging, ver. 2.24.1386 2019-12-18 10:45:25 +01:00
Milan Hanajik 296198550a CLosing modeless forms Adjustment.WMErrorsForm and PulsesTest.WMPulsesForm. 2019-12-13 18:08:55 +01:00
Milan Hanajik 9cffd9e5c8 BenchControlPanel localization. 2019-12-13 18:08:54 +01:00
Milan Hanajik 55df6e809e FixedStartDeferredEvalSeq : Delay time before grabbing images introduced. 2019-12-13 18:08:53 +01:00
Milan Hanajik 512530f456 MainSeq bug fix : Program crashed when OuterLoop.Start was started as the first test. 2019-12-13 18:08:52 +01:00
Milan Hanajik 3c7d3e5ea6 E5 modified/fixed 2019-12-13 18:08:51 +01:00
Milan Hanajik 88a7de450a Users cleanup, ver. 2.24.1382 2019-12-13 18:08:38 +01:00
Milan Hanajik 531b5d29ae (1) TestProfiles and TestWizard.TestProfileSel (2) ErrorFlags and some WM params updated from profiles (3) Proc./Profile names case insensitive, ver. 2.24.1369 2019-12-13 11:25:22 +01:00
Milan Hanajik 511ef6a1f3 ErrorFlags : (1) bool --> (sbyte)ErrorFlagsMode, (2) Mode disappeared, (3) Prepared for E1 .. E63 2019-12-13 11:18:12 +01:00
Milan Hanajik c6497ef1b4 Kepno_50 : (1) Component updates (4.12.2019), (2) TestTimeCorrection into SummaryResults 2019-12-12 12:46:17 +01:00
Milan Hanajik 61fe458ea0 French language, ver. 2.24.1368 2019-11-27 15:01:57 +01:00
Milan Hanajik a43031c0a5 TBF.UI.Results namespace --> TBF.UI.ResultsMI, etc. 2019-11-26 18:05:02 +01:00
Milan Hanajik e9c6f58e0d ALZIR_25 symbol and component added 2019-11-26 18:03:24 +01:00
Milan Hanajik 3e026d7129 Elde.RegisterReader.RegisterReader.Position, IRegisterReader.Position, etc. introduced., ver. 2.24.1365 2019-11-20 13:09:38 +01:00
Milan Hanajik dd8ea86fc3 FixedStartDeferredEval a FixedStartMassCollDeferredEval 2019-11-19 07:54:54 +01:00
Milan Hanajik b5be8f74bf (1) FixedStartSeq code cleanup, scale/tank/draining/mass measurement removed, (2) Adjustment.WMErrorsForm-s are more robust, ver. 2.24.1364 2019-11-15 16:53:57 +01:00
Milan Hanajik 0297d74b17 ROMA_200 : (1) Component upgraded (12.11.2019), (2) Dummy scale does not overwrite Tank/DrainValve info, (3) minor changes, ver. 2.24.1363 2019-11-13 08:14:01 +01:00
Milan Hanajik 708610b8ab ROMA_200 : Component added, symbol processing added, ver. 2.24.1359 2019-11-07 14:45:09 +01:00
Milan Hanajik b3fdb11b81 TestProfiles : UI changes 2019-11-07 14:00:30 +01:00
Milan Hanajik ecaca8cc6b Config.Entities.Profile, PTest, Config.Mappings.ProfileMap, PTestMap added. 2019-10-31 14:01:41 +01:00
Milan Hanajik 0a68fed3e9 TBF.UI.Bench.TestProfiles changes. 2019-10-30 09:24:52 +01:00
Milan Hanajik 21cbc4220e TBF.UI : Item.EditXyz added. 2019-10-30 09:24:50 +01:00
Milan Hanajik 7fd4966757 Uncertainty under construction, Results DB TestRslt table modified 2019-10-30 09:24:49 +01:00
Milan Hanajik 424be60a05 Bug fixes : (1) FlowMeterDewa, (2) ControlComWrap.ReferenceFreqs(int i) 2019-10-30 09:24:48 +01:00
Milan Hanajik 68d6479d20 Output.fileWriters.IperlLogger bug fix 2019-10-28 17:05:52 +01:00
Milan Hanajik 1ca6b182d4 iPerlCommunication : DelayBetweenRetries introduced. 2019-10-28 17:05:51 +01:00
Milan Hanajik 870d57fb67 (1) ProcedureDlg: Draining before/after in Process tab, (2) DoDrainingAfter implemented in test method sequences. 2019-10-28 17:05:41 +01:00
Milan Hanajik 28123c3a31 Transition sequences and hydraulic paths are not displayed and cannot be edited for test methods with DoTranisitions( ) == false. 2019-10-24 12:57:52 +02:00
Milan Hanajik d5c0eb9c09 (1) TBF.BenchControl.Elde.SendCommandArgs class and cbCommandQueue (2) DiverterToTank, DiverterToSink commands modified. 2019-10-24 12:57:37 +02:00
Milan Hanajik dbe87a375d TransitionContext.AfterTestWithOverlap, PID coef. set earlier as well, nextHydroTest in MainSeq. 2019-10-24 12:56:59 +02:00
Milan Hanajik f1147031a1 (1) Modifications for WR20, WR21 (2) ProcessData.BenchInfo.TestBenchId/TextBenchName are always used by Oracle and ProductionTracing. 2019-10-24 12:51:08 +02:00
Milan Hanajik c95860dcce iPerl : "Fix' is possible for user 'milan' even when previous records are missing 2019-10-11 16:52:20 +02:00
Milan Hanajik b37023eff7 (1) TestMethods.Dummy component, (2) Three custom shared buttons, (3) ProcedureDlg and Procedures.TestWizard modified. 2019-10-11 16:52:09 +02:00
Milan Hanajik 0934940556 SensusTestInfo extended 2019-10-11 15:06:02 +02:00
Milan Hanajik f7c10daa52 'ShowDisabledPositions' supported when displaying previous results. 2019-10-11 15:06:01 +02:00
Milan Hanajik 1d75cbc239 Oracle DB only : Refactorization : TBF.UI namespace, no change of function, part 2. 2019-10-01 12:11:10 +02:00
Milan Hanajik 2aa8b19c87 FlowMeter, FlowmeterTriplet : Condiiton (flow < 0.1 * NominalFlow) removed from LtrPerPulseCorrected( ) 2019-09-26 15:39:19 +02:00
Milan Hanajik 179735fcd1 Bug fix : Program crashed when on-screen result items were defined for the first time on a PC (columnWidths == null). 2019-09-23 07:17:42 +02:00
Milan Hanajik 9caae8dffd (1) FlowMeteDewa uses EtPulses2, EtPulses3, (2) WMChart fixed, Q4 displayed, (3) Minor MainSeq bug fix. 2019-09-22 16:37:58 +02:00
Milan Hanajik 4fc427d875 (1) StandardCamera.TestStartEndForm fixed (exclamation), (2) Simulate mode for camera with sample.bmp. 2019-09-22 16:37:55 +02:00
Milan Hanajik 688580c29f TBF ver. 2.24.1320 2019-09-22 16:37:46 +02:00
Milan Hanajik 28937ff01d Temperature, Pressure : shorter filter (7s -> 4s) and skip (5s -> 3s) times, ver. 2.24.1317 2019-09-19 15:06:36 +02:00
Milan Hanajik 6dbb6118ea UpgradeSelectionDlg : 2.18 -> 2.22 and 2.22 -> 2.24 2019-09-19 14:22:34 +02:00
Milan Hanajik adc9e4efe4 Clean-up 2019-09-19 07:45:35 +02:00
Milan Hanajik 3333b4baa2 FlowMeterDewa bug fix, wrong indices used when calculating a correction of a sum of flows. 2019-09-19 07:45:21 +02:00
Milan Hanajik a1ef22b809 ver. 2.24.1316 2019-09-19 07:43:29 +02:00
Milan Hanajik 90b760075c TBF.UI.Bench.Uncertainties : Modifications, 3 tab pages completed, 2 in preparation. 2019-09-18 18:49:11 +02:00
Milan Hanajik 74f8c44783 Config.Data.RealDensity etc., DataContainers.Density and Buoyancy components, related metrology tabs modified/created. 2019-09-18 18:49:00 +02:00
Milan Hanajik 0468b5a1f5 Conditions and Uncertainties added to Bench menu, initial versions of dialogs, Config.Entities.Ucertainty, etc. 2019-09-18 18:16:55 +02:00
Milan Hanajik fd6f305f95 ver. 2.24.1315 2019-09-18 18:16:45 +02:00
Milan Hanajik 2ca9c104d2 DEWA_300 component upgraded. 2019-09-18 14:45:21 +02:00
Milan Hanajik 994568799d Refactorization: TBF.UI namespace, no change of function, ver. 2.18.1314 2019-09-17 10:58:44 +02:00
Milan Hanajik 7f8a5c83ed Users : Password change, password requirements, password history, BackupAndSecurity component, ver. 2.18.1313 2019-09-16 08:52:20 +02:00
Milan Hanajik 99b68f1dd6 Bug fix : Crash when closing TBF program (ModelessActivityForm). 2019-09-15 10:51:14 +02:00
Milan Hanajik 604c59723f (1) Production Tracing tab removed from MoreWMResultsDlg, (2) WMChart: testRslt.TestTime used instead of mtr.TestTime, AxisX Minimum and Maximum. 2019-09-15 06:24:42 +02:00
Milan Hanajik 886d87c03d Config.Mappins.UserMap fixed for TURA_IPERL, etc. (Tag) 2019-09-14 10:41:42 +02:00
Milan Hanajik d4eb52d70e RegulValve.SetFlowOp in progress 2019-09-12 13:50:53 +02:00
Milan Hanajik e2650736cd iPerlCommunication simulation 2019-09-12 13:50:47 +02:00
Milan Hanajik 77b71d5a7d LoginDlgWithBenchSelection : Logging with full name fixed, ver. 2.18.1308 2019-09-11 15:46:15 +02:00
Milan Hanajik bd65ff5420 Cosmetical changes 2019-09-10 10:57:58 +02:00
Milan Hanajik 0449c38de2 Polish language, ver. 2.18.1305 2019-09-09 09:35:43 +02:00
Milan Hanajik eb6f76d6f5 Configuratin is encrypted for PUCHONG_200 as well, ver. 2.18.1303 2019-09-05 09:28:04 +02:00
Milan Hanajik 6fdb030b9f GID.MetrologicalAuthority, GID.WaterMeterAuthority added and used in MetrologyDlg, ProcedureDlg (KEMPNO_50), ver. 2.18.1302 2019-09-05 08:52:34 +02:00
Milan Hanajik 6079c8419f (1) Diverter switch time measurement modifications (2) const int CountWhenSendingRdDivCmd = 1, CountWhenReadingDiv = 3. 2019-09-04 15:08:36 +02:00
Milan Hanajik ef6f21eb9e Safer saving corrections to runtime component, test of a null reference. 2019-09-03 09:53:30 +02:00
Milan Hanajik 50db69e5cb ver. 2.18.1300 2019-09-02 10:21:05 +02:00
Milan Hanajik 9194871508 ver. 2.18.1299 2019-09-02 08:38:55 +02:00
Milan Hanajik 5dde27bad9 (1) Database export, import and creation completed, TODO pwd, (2) Warning message with yes/no confirmation when aborting a cycle. 2019-08-27 18:01:48 +02:00
Milan Hanajik e61e5c59cb TestMethods.Q2CorrectionFromHistory sets test results, TODO: Web service. 2019-08-27 14:40:30 +02:00
Milan Hanajik ff3118068d Delete handler subscriptions from controls (memory leak if not done???), ver. 2.18.1298 2019-08-26 14:53:41 +02:00
Milan Hanajik c3d5e157ec TestMethods.Q2CorrectionFromHistory slightly modified, no State.Create() and do {} while loop, ver. 2.18.1297 2019-08-15 18:22:53 +02:00
Milan Hanajik ef5320917a CalculatedInitQ2CorrXY added to ProcessData, used in InitOrReadQ2Correction(...), TestMethods.Q2CorrectionFromHistory added, ver. 2.18.1295 2019-08-15 16:05:17 +02:00
Milan Hanajik e37dd87ece ver. 2.18.1292 2019-08-14 23:02:46 +02:00
Milan Hanajik 128d71bcd8 ver. 2.18.1291 2019-08-14 13:56:52 +02:00
Milan Hanajik da220f4e7f Dramatic changes in displaying results on screen, ver. 2.18.1290 2019-08-14 13:30:20 +02:00
Milan Hanajik 2d42ae95f8 TestProgressControls changes in progress. 2019-08-09 09:55:35 +02:00
Milan Hanajik e0af6a5c20 (1) SaveDiverterCorr calculation fix (2) Corrections applied immediately in SaveFlowmeterCorr and SaveDiverterCorr, ver. 2.18.1285 2019-08-09 09:55:34 +02:00
Milan Hanajik 838ec17b29 TestMethods.DiverterTest bug fix, correction time applied 'DivRepetitions' times now, ver. 2.18.1284 2019-08-08 14:45:35 +02:00
Milan Hanajik b2b0be4097 ver. 2.18.1283 2019-08-07 15:22:30 +02:00
Milan Hanajik 142da5cbec ver. 2.18.1282 2019-08-07 14:27:11 +02:00
Milan Hanajik 969c983d42 Warsaw END component upgraded (16.3.2018), this fixed communication with pressure meters, ver. 2.18.1281 2019-08-07 13:38:18 +02:00
Milan Hanajik 1d86a1289d UserManagement : Config file is encrypted, ver. 2.18.1280 2019-08-07 10:38:48 +02:00
Milan Hanajik d4518ac651 ver. 2.18.1280 2019-08-07 08:57:41 +02:00
Milan Hanajik 73aa148ded ver. 2.18.1279 2019-08-06 15:38:50 +02:00
Milan Hanajik 2041b7b3b1 WR18, WR19 added to Results.Utils, ver. 2.18.1278 2019-08-06 15:37:39 +02:00
Milan Hanajik d708e6e01f Ambiet.Comet : 'Set DTR to 1' property, ver. 2.18.1277 2019-08-06 15:36:10 +02:00
Milan Hanajik 0580e04be4 Back up Configuration/Results added to menu, Import DB added to DatabaseSettingsDlg, ver. 2.18.1275 2019-08-06 15:35:59 +02:00
Milan Hanajik 59f1de4370 Test cardReaders != null before cardReadrs use. 2019-08-05 12:06:37 +02:00
Milan Hanajik bb1efb122e TBF : Configuration saved in C:\TBF\Cfg directory, ver. 2.18.1274 2019-07-25 15:13:06 +02:00
Milan Hanajik 375cea26a6 TURA_IPERL_NEW : (1) Processing symbol implemented, (2) Elde component dated 17.7.2019 added, ver. 2.18.1273 2019-07-24 15:48:32 +02:00
Milan Hanajik 156cec5596 It is not possible to fix a production tracing error if previous step record is still missing : last step is verified once again when fixing, ver. 2.18.1272 2019-07-24 15:15:09 +02:00
Milan Hanajik 98a3730fa3 MoreWMResultsDlg : Production tracing message, ver. 2.18.1271 2019-07-24 13:22:07 +02:00
Milan Hanajik 2f788adb7d (1) ProcedureDlg is initially unlocked after New/Copy/Import, (2) ProceduresDlg displays extra information in 'More' column. 2019-07-23 12:09:24 +02:00
Milan Hanajik e622718c27 (1) Encrypt console app. (2) Decode app.=> Decrypt (3) LocalSettings uses MemStream (4) PaddingMode.Zeros, ver. 2.18.1270 2019-07-23 12:09:22 +02:00
Milan Hanajik e98d633d7f FlyingMassCollComparative method supports multiple lift valves. 2019-07-23 12:09:21 +02:00
Milan Hanajik b83ffb9e9b (1) MonitoringCfg.NetAdapter parameter added, (2) It's IP address used in RegisterWorkplace(), (3) AdapterInfo class moved one level up. 2019-07-23 11:21:44 +02:00
Milan Hanajik 1d31e5c4b7 Output.DB.SaveDiverterCorrections added. 2019-07-23 11:21:43 +02:00
Milan Hanajik 1fbaccf4db Save local settings less frequently, check if UI settings were changed in SaveUISetting(). 2019-07-12 13:26:32 +02:00
Milan Hanajik c0c65f3381 Filipiny PT50 component upgraded, dated 12.7.2019. ver. 2.18.1269 2019-07-12 09:52:06 +02:00
Milan Hanajik d032d26c59 Config.Data bug fixes (Puchong, Munich), ver. 2.18.1268 2019-07-12 09:39:32 +02:00
Milan Hanajik 28a324be8d MainWnd.UI2Settings(): no ls.Save() when no UI change, LocalSettings: Saves either plain or encrypted file, ver. 2.18.1268 2019-07-12 09:19:24 +02:00
Milan Hanajik fa22b6a8c7 DiverterTest : One single statistics (temperature, ...) for complete diverter test loop 2019-07-10 16:00:27 +02:00
Milan Hanajik a89b134a5a RealDensity corrected to 998.2008 (was 988.2008) in SampleConfig/config.xml, Metrology/Density display modifications, ver. 2.18.1265 2019-07-10 15:59:42 +02:00
Milan Hanajik ed21afd82e Decode console application project added. 2019-07-10 10:02:36 +02:00
Milan Hanajik df5b240397 Results.Entities.TestRslt.IsRelErrTest() and IsDiverter() modified, ver. 2.18.1264 2019-07-10 08:58:05 +02:00
Milan Hanajik a6b8fade23 (1) DiverterTest component added, (2) Filipiny_50 component 9.7.2019, (3) flowMeterIdxAndDiv for FILIPINY_50, ver. 2.18.1263 2019-07-09 15:58:13 +02:00
Milan Hanajik 1fb6cf4717 TBF : Local settings encryption, ver. 2.18.1262 2019-07-09 12:37:33 +02:00
Milan Hanajik 4fbf471ea0 TestMethods.SensitivityTest added, STOP handled correctly in SensitivityTestSeq, ver. 2.18.1261 2019-07-08 12:52:28 +02:00
Milan Hanajik b57d22e276 Results.Output.WMChart : MarkerSize for printer = 1, MarkerStyle = Circle, ver. 2.18.1259 2019-06-30 13:15:25 +02:00
Milan Hanajik 9fa7079dc0 ResultsBrowser ver.2.18.1258 2019-06-30 12:47:01 +02:00
Milan Hanajik 2a05126444 ver. 2.18.1258 2019-06-28 14:15:47 +02:00
Milan Hanajik 58d1c1e1ef FILIPINY_50 symbol processing added to sources, component dated 28.6.2019 added, ver. 2.18.1257 2019-06-28 13:04:25 +02:00
Milan Hanajik 430e897429 MainSeq : transitionBefore : case of outer loops handled correctly, ver. 2.18.1256 2019-06-27 21:05:21 +02:00
Milan Hanajik b9b86ecaff MainSeq : transitionBefore is not executed between 2 repetitions of a test, ver. 2.18.1255 2019-06-27 11:14:26 +02:00
Milan Hanajik 1c5c260a82 Puchong : (1) RegValveCalib[] array dimensions changed, (2) component upgraded (26.6.2019), ver. 2.18.1254 2019-06-26 16:25:40 +02:00
Milan Hanajik f46352e8fd Output.FileWriter.IperlLogger bug fix : Q2 error without correction when the name of calculated test in not "Q2". 2019-06-25 18:25:32 +02:00
Milan Hanajik 096b649e40 iPerl : Pruefindex is compared with the max. allowed value only in case WM is Failed (either Pink or Magenta back color), ver. 2.18.1254 2019-06-25 18:24:09 +02:00
Milan Hanajik 4642abac2d SequenceBase : SummaryResults : tstRslt.ConstMasterRaw and tstRslt.RefFlowmeter() unstead of outPath.FlowMeter... (bug fix), ver. 2.18.1252 2019-06-25 12:08:14 +02:00
Milan Hanajik 721904dbae Diverter : flowMtrNr4Cmd fixed for PUCHONG_200, ver. 2.18.1251 2019-06-24 11:22:47 +02:00
Milan Hanajik 899caac18b (1) Puchong-200 component upgraded, 24.6.2019 : dimensions of arrays changed, etc., (2) Related ControlComWrap changes, ver. 2.18.1250 2019-06-24 10:38:20 +02:00
Milan Hanajik a07c54186f Changes simplyfying debugging. 2019-06-21 13:25:47 +02:00
Milan Hanajik e252e55197 (1) Results.Output.Printers.WMChart added, (2) Results.Forms.MoreWMResultsDlg added, (3) Output.Printers.OnePerMeter can print graphs, ver. 2.18.1249 2019-06-21 13:25:13 +02:00
Milan Hanajik b873dd5bf5 TBF : iPerl : Two bug fixes : (1) checking previous records, (2) evaluating MaxProefindex 2019-06-19 15:31:56 +02:00
Milan Hanajik 59eb1902f7 ver. 2.18.1245 2019-06-14 11:25:55 +02:00
Milan Hanajik db6903e406 TBF : SensusTestInfo for Greece added, Q2 correction for Greece modified, ver. 2.18.1244 2019-06-14 11:03:11 +02:00
Milan Hanajik 53bff92b21 Resources: (1) ResultsBrowser: unused strings removed, (2) TracingDB: Process->Workflow, Workstep->Workflow step, ver. 2.18.1243 2019-06-07 14:06:32 +02:00
Milan Hanajik f8458a4275 TURA_IPERL : Diverter.flowMtrNr4Cmd corrected. 2019-06-06 09:03:23 +02:00
Milan Hanajik 0c5003be7b Results.Entities.TestRslt.IsVolumeMethod( ) fixed, ver. 2.18.1241 2019-06-05 14:07:38 +02:00
Milan Hanajik 05bdf0dc06 TURA_IPERL || TURA_SPECIAL : TracingResultsDlg shown after a double-click on a WM results. 2019-06-05 09:02:28 +02:00
Milan Hanajik dfd8e879d1 Bug fix : 'Save results' was inactive when all test were done, but at least one WM position was disabled, ver. 2.18.1240 2019-06-03 14:09:10 +02:00
Milan Hanajik 2382ceea73 TestMethods.LeakTest : Start and End mass saved to test result. 2019-05-30 08:32:37 +02:00
Milan Hanajik 0c72e76ecc TestMethods.LeakTest : Test parameters IsPumpRunning, MaxPressureDrop and MaxMassIncrease added. 2019-05-29 15:31:11 +02:00
Milan Hanajik 6226e069eb Kepno : Component upgraded, 29.05.2019, opravene P4. 2019-05-29 15:31:08 +02:00
Milan Hanajik 47b6bb4cf7 ProductionTracing : wm.IsLastErrorOk used again, ErrorFlags bit E28 set in iPerlCheck appropriately, ver. 2.18.1235 2019-05-23 10:30:28 +02:00
Milan Hanajik bbcbee894d Users : production_tracing_administrator localized, ver. 2.18.1234 2019-05-22 14:35:58 +02:00
Milan Hanajik 944862dde0 iPerlCommunicationForm : (1) OutOfRange / Q2OutOfRange aren't an RFID error, (2) CommFailed cleanup, (3) WriteQ2Correction(..) cleanup (updateQ2adjByCalibFactor arg. 2019-05-22 14:30:10 +02:00
Milan Hanajik 14a5721649 IperlHead : TestEndTelegramIx obtained in a correct way. 2019-05-22 14:29:20 +02:00
Milan Hanajik 93bcde2599 More robust reading of the start sample from opto-data. 2019-05-21 14:40:22 +02:00
Milan Hanajik 05c312fbb9 Selected LogType name passed to caller by GetBestmatch(..) 2019-05-17 08:13:31 +02:00
Milan Hanajik 53795db720 Output. ... .Tracing.CheckPreviousRecordOfSingleWM(.) cleanup : E28 is used everywhere : fixed 2019-05-16 13:35:11 +02:00
Milan Hanajik 156215bea6 (1) Modbus.CometAmbient.Ambient. UpdateProcessData(..) was missing, (2) FixedStartMassCollection : Flow regulation stopped after test. 2019-05-16 10:34:47 +02:00
Milan Hanajik 48c021e9fb ErrorFlags.TestParams : E25, E26, E27, E28 added for IPERL 2019-05-16 10:34:37 +02:00
Milan Hanajik 357a216b6b Stopping flow regulation after test in all remaining FlyingStart.... sequences. 2019-05-15 16:05:14 +02:00
Milan Hanajik d6215178b1 MetrologyDlgEvaporationTab : Resources : Correction -> Evaporation, ver. 2.18.1229 2019-05-15 15:46:36 +02:00
Milan Hanajik 1a122cfa12 Various.Evaporation comp., MetrologyDlgEvaporationTab and IEvaporation/IScaleOrTank/ITankDraining with EvaporationRate(double T) introduced. 2019-05-15 15:14:04 +02:00
Milan Hanajik 59087474d9 Results.Entities.TestRslt.TestTimeCorrection added and used in test methods with diverter. 2019-05-15 11:18:38 +02:00
Milan Hanajik 3fceee156b (1) MetrologyDlgDiverterTab added to UI, (2) double TestTimeCorrection(double flow) added to IDiverter and implemented in Elde.Diverter and Dummy.Diverter. 2019-05-15 11:18:20 +02:00
Milan Hanajik 55ed11ae58 Results.Entities.TestRslt.TimeBtwnMassMsrmnts added, evaluated in test methods, ver. 2.18.1226 2019-05-14 16:59:20 +02:00
Milan Hanajik 39f44ad2e3 (1) ConstMasterCorr added to results, (2) MakeSimulated( ) for FlyingStartMassCollection enhanced. 2019-05-13 11:43:42 +02:00
Milan Hanajik 3075169fd1 Output.ProductionTracing.Tracing.CheckPreviousRecordOfSingleWM(.) cleanup : E28 is used everywhere, ver. 2.18.1225 2019-05-13 09:50:58 +02:00
Milan Hanajik d51edbfbfe Elde.FlowMeterDewa : (1) Exact LtrPerPulseCorrected calc. (2) nominal flow and flowmeters bitfield (=Idx0) calculated from particular flowmeters. 2019-05-12 08:17:52 +02:00
Milan Hanajik 7724c004a0 Elde interface : filters, pidCoef and shortPulses are set by SetFilterPidShortPulses( ) only. 2019-05-10 16:28:18 +02:00
Milan Hanajik 6b42dd091f MetrologyDlgFlowMeterTab, ...BalanceTab, ...PressTab, ...TempTab : Error column added. 2019-05-10 15:11:32 +02:00
Milan Hanajik 4221de3b22 Stopping flow regulation modifications : cmd=Stop, real flowMeterNr used. 2019-05-10 10:53:48 +02:00
Milan Hanajik a4debe7ac0 Bug fixes in Results.Entities (CopyContentFrom(.)) 2019-05-10 10:08:00 +02:00
Milan Hanajik c1cfc67cce Bug fix in calculated Q2 error value MakeQ2CorrectedFrom( ), iPerl.CalibTargetQ2 is used now, ver. 2.18.1219 2019-05-10 08:38:46 +02:00
Milan Hanajik 7fa06079c2 Short pulses bug fix : argument was not sent when reading diverter transitions, ver. 2.18.1218 2019-05-09 16:22:20 +02:00
Milan Hanajik a0818e3605 SensusTestInfo : LogType.DEWA_wo_Q2 added, ver. 2.18.1217 2019-05-09 15:15:05 +02:00
Milan Hanajik 8197777e69 SummaryResults : ErrorMaster from a correction curve for a volume method. 2019-05-09 11:23:43 +02:00
Milan Hanajik 667f548101 ControlComWrap logging levels modified. 2019-05-09 10:42:51 +02:00
Milan Hanajik fa1dc3cc62 (1) DAWA 300 has 10 water meter, (2) Results screen updated after a counter increment. 2019-05-07 14:37:03 +02:00
Milan Hanajik fed11e6439 Short pulses bug fix. 2019-05-07 13:24:33 +02:00
Milan Hanajik d197629cdb Static counters added (not mapped to DB now), ver. 2.18.1213 2019-05-07 12:36:47 +02:00
Milan Hanajik f8a2126c90 TestMethods.Counter added, ver. 2.18.1211 2019-05-06 13:45:07 +02:00
Milan Hanajik 5955a47518 ver. 2.18.1210 2019-05-06 10:22:11 +02:00
Milan Hanajik 32a13ecf49 (1) Ref.flowmeter, Test method Elde (string) added to result items (2) FileWriters.Elde.Writer (3) New DEWA300 component (3.5.2019), ver. 2.18.1209 2019-05-06 10:13:55 +02:00
Milan Hanajik 5936efcad2 IperlHead : Opto data correctly saved in case of test repetitions (iPerlSpecial), ver. 2.18.1208 2019-05-03 12:14:52 +02:00
Milan Hanajik 04547306d0 Bug fix : Purging sequence is executed after cycle selection after a STOP in the previous evacuation sequence, ver. 2.18.1207 2019-05-03 09:47:26 +02:00
Milan Hanajik d0bba74dff (1) filters[] initialized earlier in test method sequences, (2) filters and shortPulses used in SetFlowOp(.), ver. 2.18.1206 2019-05-02 10:23:33 +02:00
Milan Hanajik 1e97a26863 (1) PreviousResults : 'Fix' option added to 'Send again' and 'Reload', (2) Missing PCB nr. does not cause a production tracing error. 2019-04-30 13:17:08 +02:00
Milan Hanajik 6341d5a474 (1) WMTypeID loaded correctly when restoring a batch, (2) WMTypeID, WMTypeRev, E25, E26, E27 and E28 added to results, ver. 2.18.1205 2019-04-30 09:50:29 +02:00
Milan Hanajik e9bda4f1b2 Short pulses test parameter used in SendCommand(..., shortPulses), ver. 2.18.1204 2019-04-29 10:36:08 +02:00
Milan Hanajik 6cc10d221d Output.FileWriters.Elde added, ver. 2.18.1204 2019-04-26 13:00:47 +02:00
Milan Hanajik 3d243c0a19 MainSeq : Cosmetical changes. 2019-04-26 09:50:04 +02:00
Milan Hanajik e32a484e81 IperlHead procedure parameter CalibTargetQ2 added, ver. 2.18.1203 2019-04-25 13:53:08 +02:00
Milan Hanajik 5dad80d031 Stopping flow regulation after a test completes (in three test methods). 2019-04-25 11:00:34 +02:00
Milan Hanajik 24e23d01e8 More changes : RequredFlowLo/Hi, ReferenceFlow, RefereneFreq, etc. float -> double, ver. 2.18.1202 2019-04-25 08:58:54 +02:00
Milan Hanajik b2ae78e0d9 SensusTestInfo for DEWA modified, ver. 2.18.1201 2019-04-24 11:46:01 +02:00
Milan Hanajik 79fe396a6d ver. 2.18.1200 2019-04-23 08:59:14 +02:00
Milan Hanajik cfb29c8149 DataEntry.Fewa.EntryForm added, ver. 2.18.1199 2019-04-20 10:07:31 +02:00
Milan Hanajik 960dc9d53a Output.SensusOracle.Database bug fix, as a consequence sometimes the IperlLogs were not written, ver. 2.18.1198 2019-04-19 11:18:49 +02:00
Milan Hanajik 03180392b0 IperlLogger : (1) Retv.Error handled properly, (2) more logging, ver. 2.18.1197 2019-04-18 11:23:19 +02:00
Milan Hanajik 03aa29cf75 SensusTestInfo for DEWA changed, ver. 2.18.1196 2019-04-18 09:35:40 +02:00
Milan Hanajik d724dab388 ver.2.18.1195 2019-04-15 16:20:55 +02:00
Milan Hanajik 208510921a DEWA : (1) Modification of SensusTestInfo, (2) Minor Q2 correction change, ver. 2.18.1194 2019-04-15 09:06:04 +02:00
Milan Hanajik 51d28fc5a9 ver. 2.18.1193 2019-04-15 08:20:24 +02:00
Milan Hanajik f8671ac516 (1) Range of flow extended to 125%, (2) RequredFlowLo/Hi etc. float -> double, ver. 2.18.1192 2019-04-15 08:15:47 +02:00
Milan Hanajik 556290abf6 DEWA300 double and tripple flowmeters, NominalFlow and LtrPerPulse are doubles, ver. 2.18.1191 2019-04-11 15:39:46 +02:00
Milan Hanajik e1e74e1588 IperlLogger fix (adjustment, negative PruefungsNrLog), etc., ver. 2.18.1189 2019-04-09 13:05:16 +02:00
Milan Hanajik fa7565e541 iPerlSpecial : MainWnd does not process num. keys, coax valve can be controlled manually, ver. 2.18.1188 2019-04-09 09:49:32 +02:00
Milan Hanajik 3c341d4d97 Test method sequences : Correct error message on flow setting timeout. 2019-04-08 10:34:12 +02:00
Milan Hanajik b8a16f1301 Q2 correction calculation and Q2CorrectionCheck activity modifications, ver. 2.18.1187 2019-04-08 09:44:13 +02:00
Milan Hanajik 33947e383f ver. 2.18.1186 2019-04-05 09:49:11 +02:00
Milan Hanajik 6a61c9400b Q2CorrectionCheck modified, ver. 2.18.1185 2019-04-05 09:04:44 +02:00
Milan Hanajik 32d560d164 SensusTestInfo fixes for repeatability and EMP, ver. 2.18.1184 2019-04-04 14:23:50 +02:00
Milan Hanajik 809b067260 Clean-up, Q2Corretion and Q2CorrectionDone removed from Results DB, ver.2.18.1183 2019-04-04 10:23:52 +02:00
Milan Hanajik b235f9ae20 (1) SUEZ cycle: InitOrReadQ2Correction, (Conditional)UpdateQ2Corrections, (2) Flow dir. detection fixed, (3) etc., ver. 2.18.1182 2019-04-03 16:19:46 +02:00
Milan Hanajik e356934ede ver. 2.18.1176 2019-03-28 09:17:33 +01:00
Milan Hanajik 2c4c76343d SensusOracle.Database and ProductionTracing.Tracing : CurrentOp => OpState with ...Scheduled and ...Running satates, ver. 2.18.1174 2019-03-22 11:21:06 +01:00
Milan Hanajik b8c4f35b1a 'completeTestInfo' reloaded when only the procedure changes (and not wmTypeID), usefull for iPerlSpecial, ver. 2.18.1174 2019-03-21 15:36:42 +01:00
Milan Hanajik c855a18c61 SensusTestInfo matching and its use in SensusOracle.Database and IperlLogger.Writer reimplemented, ver. 2.18.1173 2019-03-21 14:20:17 +01:00
Milan Hanajik d40f6a6c15 Output.DB.SensusOracle.Database : TestMode (no writes to DB). 2019-03-20 10:58:09 +01:00
Milan Hanajik a2bb50117e StartInfo is read from DB when previous results were reloaded. 2019-03-20 09:57:41 +01:00
Milan Hanajik 8624f30f71 IperlLogger bug fix, ver. 2.18.1172 2019-03-20 08:47:08 +01:00
Milan Hanajik 9fecf05b3f (1) ProcessTabPageEx: TRefHi, TRefLo (2) Ambient vals. written directly to ProcessData (3) Sequences changed:'readTempPressOps', ver. 2.18.1171 2019-03-20 08:25:01 +01:00
Milan Hanajik 0041ec9616 TURA_SEPCIAL uses ProcessTabPageExCtrl in MainWnd.Designer. 2019-03-20 08:23:03 +01:00
Milan Hanajik 77c26abc02 TBF.Screens.ProcessTabPageHeatMetersCtrl completed. 2019-03-17 12:29:04 +01:00
Milan Hanajik 0c964fdb5b ComponentsManagerDlg : Copying to subsequent cells via right-click implemented, ver. 2.18.1168 2019-03-16 10:19:57 +01:00
Milan Hanajik 84322476d6 SensusOracle and IperlLogger write only data of iPerls without any production issues. 2019-03-15 10:55:12 +01:00
Milan Hanajik f1278dd9a5 IperLogger : (1) Logging of TestInfo-s, (2) using (TextWriter logger = new ... ) { try {...} catch { } } construction. 2019-03-15 10:37:35 +01:00
Milan Hanajik e7164b98ff (1) TBF.Screens.ResultsTabPageCtrl fixes, (2) Results.Forms.BatchResultsDlg fixes : Show previous results displays colors, ver. 2.18.1167 2019-03-15 10:37:20 +01:00
Milan Hanajik 26d49eb4b7 DEWA300 component upgraded (13.3.2019), ver. 2.18.1165 2019-03-14 08:15:42 +01:00
Milan Hanajik b410f473e2 TempMeter zero-based index range extended to 0..15, ver. 2.18.1164 2019-03-13 09:39:10 +01:00
Milan Hanajik 3e54204a17 ResultsTabPageCtrl : iPerl is rejected also when proefindex==limit and it failed the test, ver. 2.18.1163 2019-03-13 08:50:43 +01:00
Milan Hanajik 70cba76ffd (1) iperl_check with Continue/Abort (2) MeterTestRslt.ErrorIndicators (not in DB) (3) ErrorFlags.Errors modif. (4) ResultsTabPage commonBackColor, etc. 2019-03-12 11:15:59 +01:00
Milan Hanajik d45c3f96d6 TBF : (1) flow setting timeout = 300 s = 5 min., (2) stable mass msrmnt. timeout = 300 s = 5 min., ver. 2.18.1162 2019-03-11 08:36:02 +01:00
Milan Hanajik 684fed8fc0 IDataEntry supports bool Completed property. 2019-03-08 10:20:58 +01:00
Milan Hanajik 99bb0cec57 LargeMessageBoxForm : (1) is red, (2) OK button is always visible, (3) auto scroll bar. 2019-03-08 10:20:57 +01:00
Milan Hanajik 263d990be4 Output.DB.ProductionTracing : Checking previous records at the beginning of the cycle. 2019-03-08 10:13:37 +01:00
Milan Hanajik 5f6c1fe70a Output.DB.SensusOracle cleaned up : CheckBarcodeScanningOp removed, ver. 2.18.1161 2019-03-08 07:24:51 +01:00
Milan Hanajik 2e76d595c0 Quido RS 4-4 support added, ver. 2.18.1160. 2019-03-06 10:45:58 +01:00
Milan Hanajik 75e5b75d4d DEWA_300 : (1) component upgraded (6.3.2019), (2) Diverter: flowMtrNr4Cmd fixed, ver. 2.18.1159 2019-03-06 09:42:25 +01:00
Milan Hanajik b47f5e32d4 DEWA_300 symbol usage fixed, ver. 2.18.1158 2019-03-05 15:12:24 +01:00
Milan Hanajik 771af696ae (1) TBF program shutdown modifications, (2) Obligatory tank draining before TBF exit, (3) Shutdown PC after TBF exit option, ver. 2.18.1156 2019-03-05 12:28:58 +01:00
Milan Hanajik b10ab44fa9 (1) MetrologyDlg displays corrections for all pressure meters, (2) Elde.PressureMeter and Modbus.PressureMeter.Meret use corrections. 2019-03-04 09:20:16 +01:00
Milan Hanajik 13eb7138a3 TracingDB : Cleaned-up and upgraded to current version, TBF : Workplace registered for approx. 2 weeks. 2019-03-01 14:16:04 +01:00
Milan Hanajik 02f6c9264a MID Statistics is data driven, no MidId enum, ver. 2.18.1154 2019-02-28 15:13:44 +01:00
Milan Hanajik edb26ccf6e ver. 2.18.1154 2019-02-28 10:03:52 +01:00
Milan Hanajik 2574ce1aee ver. 2.18.1153 2019-02-27 08:11:50 +01:00
Milan Hanajik 5586f58c6e iPerlCommunicationForm : Better try/catch, more logging, ver. 2.18.1152 2019-02-25 16:15:41 +01:00
Milan Hanajik 138e436645 (1) DEWA_300 component added, (2) DEWA_300 symbol added, (3) IZRAEL_200 symbol bug fix, ver. 2.18.1151 2019-02-25 12:49:04 +01:00
Milan Hanajik ea7e727798 (1) Modbus.QuidoRS.ConfirmationForm added, (2) Use of QuidoRS in iPerlCommForm fixed - uses QuidoRS.Variant, ver. 2.18.1149 2019-02-25 11:05:21 +01:00
Milan Hanajik 7a40cfb1f2 More logging in ShowBenchWaitingOp and ShowBenchErrorOp. 2019-02-22 12:48:51 +01:00
Milan Hanajik b2226ad779 iPerlCommunication : TestModeConfig value verified after switching to a test mode. 2019-02-21 16:00:01 +01:00
Milan Hanajik ebf96f655c Output.DB.SaveFlowmeterCorrections : Corrections calculated differently, from FlowVolume, not FlowMean. 2019-02-20 15:11:58 +01:00
Milan Hanajik 4134bf8875 ProcessTabPageHeatMetersCtrl modifications, language resources, etc. 2019-02-20 14:21:18 +01:00
Milan Hanajik fd7149e263 Screens.ProcessTabPageHeatmetersCtrl added, ver. 2.18.1148 2019-02-20 11:35:57 +01:00
Milan Hanajik a40b4ff606 Added: (1) IParallelOutput, (2) StateMachine.BenchWaitingOp/BenchErrorOp, (3) Modbus.QuidoRS support for Quido RS 8/8 (4) etc., ver. 2.18.1147 2019-02-20 08:34:03 +01:00
Milan Hanajik 86c063caee ReasultsBrowser : Histograms added, ver. 2.18.1146 2019-02-19 14:42:46 +01:00
Milan Hanajik bea3c04eb7 Output.DB.SensusOracle.Database : Writing results more robust, preventing program crash. 2019-02-18 09:04:00 +01:00
Milan Hanajik c5644d6999 iPerlCommunication cleanup, ver. 2.18.1144 2019-02-15 15:36:08 +01:00
Milan Hanajik 29c4c869f2 iPerlCommunication 'iPerlCheck' fixed : Writes correct WMPositions (not wmNr0), ver. 2.18.1143 2019-02-14 08:16:16 +01:00
Milan Hanajik 707c093f0c Heat meter results, ver. 2.18.1142 2019-02-13 15:39:44 +01:00
Milan Hanajik abaf756980 (1) Reading Q2 corrections form iPerl fixed (was unsigned), (2) Displaying ProdQ2CorrRL/LR fixed, ver. 2.18.1141 2019-02-13 13:12:52 +01:00
Milan Hanajik 32873ee2b0 (1) Auto. wmTypeRev (2) IperlCheck t.meth. (3) Pruefindex, Q2corr. read from Ora.on start (4) VolStart/VolEnd written to Ora. bounded, (5) iPerlCommForm.ReadQ2Corr() bug fix (6) LU logging cleanup, etc, ver. 2.18.1140 2019-02-13 09:27:22 +01:00
Milan Hanajik dd8273798a TestMethod.Adjustment : Bug fix for the case Publish==Never (Izrael) 2019-02-06 14:05:49 +01:00
Milan Hanajik 0dae18e5e8 Output.DB.SensusOracle cleanup. 2019-02-05 14:13:37 +01:00
Milan Hanajik 17063518ce Bug fix : Saving to Oracle failed due to large VolumeStart/VolumeEnd values, ver. 2.18.1131 2019-02-05 12:36:17 +01:00
Milan Hanajik a4998521f5 ver. 2.18.1131 2019-02-05 12:20:38 +01:00
Milan Hanajik d2df1a678f (1) Writing both Q2 corr. factors fixed, (2) Q2 corr. factors for std. R800 meters calculated differently, (3) Writing WMPosition to iPerlLog, (4) OptoTelegram start/end label. 2019-02-04 13:55:13 +01:00
Milan Hanajik f6aa6ba2d6 ResultsTabPage layout modifications 2019-01-30 15:38:51 +01:00
Milan Hanajik 82743bac05 Results : TestPartStr item added, ver. 2.18.1127 2019-01-30 15:35:25 +01:00
Milan Hanajik 30df663634 iPerlSpecial : Bug fixes in results DB changes, reading from Oracle and new result items, ver. 2.18.1126 2019-01-30 10:14:24 +01:00
Milan Hanajik f8ac27ba3c iPerl : (1) results DB change, (2) reading from Oracle on cycle start, (3) reading Q2 corr. factors from iPerl, (4) new result items, (5) MainSeq cleanup, ver. 2.18.1125 2019-01-29 16:05:29 +01:00
Milan Hanajik 88496cf003 Calculated error limits for heat meters, change in flow calculation, for Kepno PT50, etc. 2019-01-25 16:39:16 +01:00
Milan Hanajik 4e2c4c3bac TBF : (1) SharedButtons: opt. buttons positions automated, (2) Export and import of transition sequences, ver. 2.18.1122 2019-01-25 13:22:05 +01:00
Milan Hanajik 9bed5e6682 Ambient cleanup, ver. 2.18.1120 2019-01-23 08:26:53 +01:00
Milan Hanajik c6e1d672e5 TBF : Saving positions of maximized or minimized forms fixed, ver. 2.18.1119 2019-01-22 20:28:13 +01:00
Milan Hanajik 8b2d01a5ac TBF : 'Previous' / 'Next' buttons in PreviousResultsDlg, ver. 2.18.1118 2019-01-22 15:50:37 +01:00
Milan Hanajik 2037f8bbe7 ver. 2.18.1116 2019-01-17 14:42:41 +02:00
Milan Hanajik 772cfc8e29 TBF : KPackE.Radio, KPackE.DataEntryForRadio, KPackE.RegisterReader and IReceivesDataFromRadio added, ver. 2.18.1115 2019-01-17 14:39:10 +02:00
Milan Hanajik 1eebb3b4a1 ResultsBrowser : Searching for a list of water meters added, ver. 2.18 1115 2019-01-17 09:15:24 +02:00
Milan Hanajik 550fe20094 Izrael PT200 component upgraded (17.01.2019) : Fixes in regulation valves and a coax, ver. 2.18.1114 2019-01-17 09:15:03 +02:00
Milan Hanajik 25e6a04a98 ver. 2.18.1113 2019-01-16 11:11:04 +02:00
Milan Hanajik ab8f550bb3 DataEntry.Single added. 2019-01-16 10:55:30 +02:00
Milan Hanajik c59d2cf52c DataEntry forms modified: Magnified text shown, Standard24 is finished and well tested, ver. 2.18.1112 2019-01-16 10:55:21 +02:00
Milan Hanajik 23c9fadf86 (1) Elde.ControlComWrap modified for IZRAEL_200, (2) DB upgrade deals with FixedStartCombinedMeters component, ver. 2.18.1111 2019-01-15 11:40:43 +02:00
Milan Hanajik f5926259a7 Config.Entities.Test : Support for tests using multiple (but not all) lines (Israel PT50, 4 lines). 2019-01-14 15:33:36 +02:00
Milan Hanajik f180af692f DataEntry.Standard#.TestStartEndForm disabled text boxes for meters where the related register reader == null, ver. 2.18.1110 2019-01-14 13:24:34 +02:00
Milan Hanajik d3ca871eb5 Output.Printers.Label.Printer re-implemented using a configurable list of items, ver. 2.18.1109 2019-01-13 16:34:38 +02:00
Milan Hanajik 58f046ca34 ResultsBrowser : Batch number filter added, ver. 2.18.1110 2019-01-11 18:05:12 +01:00
Milan Hanajik e1c4da482a ResultsBrowser : (1) benches supported, (2) Configuration in user\AppData\Local\ResultsBrowser, ver. 2.18.1109 2019-01-11 14:25:53 +01:00
Milan Hanajik b7a079515c TBF : (1) SensusOracle.Database implements IStartInfoReader, (2) MainSeq invokes ReadStartInfoOp of result writers that implement IStartInfoReader. 2019-01-11 10:37:29 +01:00
Milan Hanajik 5849984381 Statistics : (1) LocalSettings folder is optional, (2) LocalSettings changes, (3) New conn. strings/IP addr., (4) Flow ranges saved. 2019-01-09 10:04:44 +01:00
Milan Hanajik a75a7d0a4a IPERL : Component updated (8.1.2019), temperature displayed with 2 decimal digits. 2019-01-08 10:44:52 +01:00
Milan Hanajik 4fa2159e61 ResultsBrowser: WM Position filter added, ver. 2.18.1108 2019-01-08 10:44:51 +01:00
Milan Hanajik 3f3a01857b iPerlHead : FLow filtering by FIRFilterFlow() corrected, ver. 2.18.1109 2018-12-31 23:11:17 +01:00
Milan Hanajik c37f15bae2 iPerlHead : Full opto data buffer length, ver. 2.18.1108 2018-12-21 09:47:45 +01:00
Milan Hanajik 2bce044cba (1) iPerlHead bug fix : Support for very long tests exceeding optodata buffer size, (2) Berlin fixes (IScaleOrTank), ver. 2.18.1107 2018-12-21 09:35:37 +01:00
Milan Hanajik 1937850814 Statistics : 5 flow ranges and charts. 2018-12-21 08:14:42 +01:00
Milan Hanajik 1703c5dcc2 Test start for 'Fixed start/stop method' modified, ver. 2.18.106 2018-12-19 14:41:16 +01:00
Milan Hanajik 6b803444f0 Statistics : First working version, ver. 2.18.1104 2018-12-19 12:24:37 +01:00
Milan Hanajik 76042756b1 (1) Verification whether Div ThresholdHI is greater then ThresholdLO, (2) Fixed a bug when no graph was selected and layout mode was changed. 2018-12-18 13:58:09 +01:00
Milan Hanajik 2f3f67c82e IPerlHead : more logging when saving opto data, ver. 2.18.1103 2018-12-18 12:37:49 +01:00
Milan Hanajik 97c041801f PressureMeter : Protocol selection in component properties (Meret, Modbus), ver. 2.18.1102 2018-12-18 10:28:34 +01:00
Milan Hanajik 7d968ba9b4 Izrael25 : Regulation valve ADC numbers, ver. 2.18.1101 2018-12-18 07:42:21 +01:00
Milan Hanajik d3cd831e03 iPerlHead : Support for very long tests exceeding optodata buffer size, ver. 2.18.1099 2018-12-17 14:13:21 +01:00
Milan Hanajik 20b2b9da97 (1) ResultsBrowser : Import of printer configuration, (2) DataEntry.Combined.CycleBeginningForm with Remark, ver. 2.18.1098 2018-12-14 16:47:32 +01:00
Milan Hanajik 55aff104ae (1) ResultsBrowser ver. 2.18.1096, (2) Reload previous results button shown always, translated to German. 2018-12-14 14:00:15 +01:00
Milan Hanajik 9ba3fd34d3 Handling of error conditions in ProcedureDlg (e.g. when sensors are changed and user changes parameters without reopening), ver. 2.18.1096 2018-12-14 11:40:59 +01:00
Milan Hanajik bb8b4a6fd6 Munich 14.12.2018: Table (fixed column widths), MunichPrintDocument (up to 5 pages, flow calculation, etc), bug fixes, ver. 2.18.1094 2018-12-14 09:30:52 +01:00
Milan Hanajik 1b7dbec443 IZRAEL_25 : Processing this symbol added, component added, ver. 2.18.1089 2018-12-12 19:30:19 +01:00
Milan Hanajik 6f8ad1638f StateMachine : Inserted two 1/10 sec. delays between RunDeviceBefore(), RunOperations() and RunDeviceAfter(). 2018-12-12 11:36:05 +01:00
Milan Hanajik 695cca6509 Statistics project added, ver. 2.18.1088 2018-12-12 11:29:06 +01:00
Milan Hanajik 9417415781 Output.DB.SensusOracle.Database : Q2CORRECTIONLEFT and Q2CORRECTIONRIGHT in VT_IP_ZAEHLER_PINDEX_PD swapped, ver. 2.18.1088 2018-12-10 15:23:41 +01:00
Milan Hanajik a626cec54e ZODINO symbol handled, Elde component for Zodino added, ver. 2.18.1087 2018-12-06 14:49:52 +01:00
Milan Hanajik 4419c5361c iPerlHead : iPerl flow direction evaluation uses max. and min. slope (=flow). 2018-12-05 08:29:11 +01:00
Milan Hanajik 70f3dbbf5d iPerlHead : iPerl flow direction detection fine tuning, ver. 2.18.1086 2018-12-04 10:06:10 +01:00
Milan Hanajik 0e37e7217d iPerl flow direction detection : Change of flow direction supported, ver. 2.18.1085 2018-12-04 08:58:46 +01:00
Milan Hanajik 5f4cf04edb iPerl flow direction detection and display, ver. 2.18.1082 2018-12-03 18:46:42 +01:00
Milan Hanajik 58fad28546 Component for SLM END upgraded, 30.11.2018, position of temperature meters changed, ver. 2.18.1081 2018-11-30 08:58:15 +01:00
Milan Hanajik c783967d87 ver. 2.18.1080 2018-11-29 14:34:17 +01:00
Milan Hanajik b0c95c0677 Output.FileWriters.IperlLogger : Request from Joachim in email 28.11.2018 11:18, ver. 2.18.1079 2018-11-28 13:06:01 +01:00
Milan Hanajik 439f20bc95 Modbus.UltrasoundLevelMeter : (1) telegrams with distance==0 are ignored, (2) IVolumeMeter interface removed, ver. 2.18.1078 2018-11-28 13:00:53 +01:00
Milan Hanajik 7576a68651 CEVAK-200 reverted to version dated 13.11.2018 2018-11-28 10:53:23 +01:00
Milan Hanajik b6380ff896 DataEntry.Standard6 : remarkTextBoxes --> remarkComboBoxes with history, ver. 2.18.1077 2018-11-28 10:47:48 +01:00
Milan Hanajik c3fd5b9366 CEVAK_200 & FlyingStart[Tank|Mass]Collection : Water stopped immediately after test, before measuring the volume/mass. 2018-11-27 07:49:17 +01:00
Milan Hanajik aa24558d07 DataEntry.Standard6.CycleBeginningForm: Remark added, Results.ItemID: WM_remark, etc. added, ver. 2.18.1076 2018-11-26 14:00:44 +01:00
Milan Hanajik 40d4c74493 Bug fix in SequenceBase : FEWA-50 was crashing in Adjustment when T div was not defined), ver. 2.18.1075 2018-11-26 09:54:46 +01:00
Milan Hanajik bc89faf220 ver. 2.18.1074 2018-11-21 07:51:58 +01:00
Milan Hanajik 0b12e79820 FlyingStartMassCollComparative : Reference mass measurement error should be within 3%, ver. 2.18.1073 2018-11-21 07:16:08 +01:00
Milan Hanajik 7bdb7f99d4 FlyingStarMassCollComparative : Mass updated when comparative measurement done, ver. 2.18.1072 2018-11-20 17:49:58 +01:00
Milan Hanajik afea809b97 TestMethods.FlyingStartMassCollComparative.Sigle/Compound/HeatMeters added, ver. 2.18.1071 2018-11-20 17:11:22 +01:00
Milan Hanajik 3122f6dd9a Components upgraded: CEVAK-200 19.11.18 - logging of commands, FEWA-50 19.11.18 - control of valves for mass calibration, ver. 2.18.1070 2018-11-20 14:07:29 +01:00
Milan Hanajik a2f0781fb4 ver. 2.18.1068 2018-11-19 08:23:27 +01:00
Milan Hanajik 31a684f03a (1) DataEntry.iPerl.CycleBeginningForm displays iPerl dir. (2) iPerlCommFrm: CalLNA logged ok (3) FlyStMassCollProlonged and SmryResults modif, ver. 2.18.1067 2018-11-16 14:30:58 +01:00
Milan Hanajik 89eddaa3c2 Transition sequence before test is executed also between two test repetitions, ver. 2.198.1066 2018-11-14 16:41:58 +01:00
Milan Hanajik b060068a95 (1) Nivotrack.ReadStableLevelOp implemented, (2) MettlerToledo.Standard.ReadStableMassOp bug fix, (3) UpdateWeights() clean-up, ver. 2.18.1065 2018-11-14 15:49:43 +01:00
Milan Hanajik 3ffdf4e2cc WaitTankContainsMoreThenOp, related Various.TankWithLevelMsrmnt and TankDraining changes, ver. 2.18.1064 2018-11-14 13:07:37 +01:00
Milan Hanajik 7d1d95305f Transition between two repetitions added. 2018-11-14 08:23:01 +01:00
Milan Hanajik 98fc15a709 bool TestParams.ManualLevelMsrmnt added to ...TankCollection methods, is used in sequnces, ver. 2.18.1062 2018-11-13 18:02:57 +01:00
Milan Hanajik a8e0a8087d Stable level and volume measurement ... in progress. 2018-11-13 16:31:20 +01:00
Milan Hanajik f81c30f072 Elde component updated, water tower tank volume display, 13.11.2018 2018-11-13 15:29:19 +01:00
Milan Hanajik 05f6c8c75c UpdateTankWeightOp removed, ver. 2.18.1061 2018-11-13 15:29:18 +01:00
Milan Hanajik 76a08324b4 CtrlBrd.UpdateWeights() updates also tanks, is used in CtrlBrd.RunDeviceAfter(), UpdteTankWeightOp becomes obsolete, ver. 2.18.1060 2018-11-13 15:29:05 +01:00
Milan Hanajik 2a98c485ef ILevelMeter.Level (immediate measurement), Nivotrack uses correction table, etc. 2018-11-13 10:00:09 +01:00
Milan Hanajik 872409870e MetrologyDlgLevelMeterTab added. 2018-11-13 09:42:23 +01:00
Milan Hanajik f48a71ce12 UiBridge.Bridge.CloseModelessFormHandler isn't used, tank draining before a test is optional, fixes in simulations, ver. 2.18.1056 2018-11-12 16:57:28 +01:00
Milan Hanajik d2d571945c ver. 2.18.1055 2018-11-09 17:03:45 +01:00
Milan Hanajik bd9c3aa5e2 Q2 correction for Suez (RL, LR) modified, 'Q2 correction check Q2bc Q2ac' test method implemented. 2018-11-09 16:25:54 +01:00
Milan Hanajik 73ea0ff586 Previous results display software version, ver. 2.18.1054 2018-11-09 11:25:18 +01:00
Milan Hanajik 78408ed5eb Density calculated from (T up + T dn) / 2 and (Pr up + Pr dn) / 2 used everywhere, ver. 2.18.1053 2018-11-08 13:45:01 +01:00
Milan Hanajik f04cdccd20 EtPulsesK (FlyingStartMassCollectionProlonged) fixed for IPERL_TURA and IPERL_SPECIAL, ver. 2.18.1052 2018-11-08 10:41:05 +01:00
Milan Hanajik 82acf60f2e Target flow range for flow control shrinked by 15% from each side, ver. 2.18.2051 2018-11-08 09:54:40 +01:00
Milan Hanajik 68413867ad FlyingStartMassCollectionProlonged fixed for iPerlSpecial, ver. 2.18.1050 2018-11-07 16:28:36 +01:00
Milan Hanajik 1fd8881d53 LastError added to MeterTestRslt, result items, etc. when ORACLE_DB defined, etc. (CalibFactorLNA, OrigCalibFactorLNA) 2018-11-07 08:43:36 +01:00
Milan Hanajik cebdd71065 MID pulses for each meter calculated correctly in all FlyingStart... methods for datastream meters. 2018-11-07 08:13:48 +01:00
Milan Hanajik 668304cb72 Bug fix in Statistics : Min, Max calculation and UpdateGraph( ), ver. 2.18.1049 2018-11-06 13:39:49 +01:00
Milan Hanajik c28c5a5554 Bug fix in Various.TankWithLevelMsrmnt.Tank. 2018-11-02 10:17:52 +01:00
Milan Hanajik 450493069c (1) SequenceBase.DrainTheTank( ) : DrainValve2 is open first, DrainValve in the 2nd half, (2) Two phase draining in MainSeq when bench is started, ver. 2.18.1047 2018-10-26 11:21:07 +02:00
Milan Hanajik d7519aa95a Draining with 2 drain valves in SequenceBase. 2018-10-25 19:44:54 +02:00
Milan Hanajik e89ab89874 TankCfgCtrl displays ILevelMeter-s, DrainValve2 is in IScaleOrTank and TankWithLevelMsrmnt UI, ver. 2.18.1046 2018-10-25 18:09:08 +02:00
Milan Hanajik 025fa81941 SequencBase : ReadRegistersTempPressAmbient( ) fixed - works OK without an IScale - start/stop method works with a tank, ver.2.18.1045 2018-10-25 17:02:12 +02:00
Milan Hanajik 845c66b511 HART communication : IHart,Hart, Nivotrack changes, sending/receiving works OK. Todo: Interface the level, ver. 2.18.1044 2018-10-25 15:34:48 +02:00
Milan Hanajik 3725e238fc Various.TankWithLevelMsrmnt can use a calibration table loaded from a CSV file. 2018-10-25 15:34:46 +02:00
Milan Hanajik ac2ac82187 Diverter fixed for CEVAK_200, ver. 2.18.1042 2018-10-24 17:16:56 +02:00
Milan Hanajik 5e6be0c4b4 (1) Bug fix in calculations in flying start methods when WMPulses == 1, (2) VolumeCTV results item added, ver. 2.18.1041 2018-10-24 15:04:51 +02:00
Milan Hanajik ed66c6a259 (1) Tank & ManualLevelMsrmnt components added, (2) Sequences cope with IScaleOrTank, (3) FixedStartTankCollection & FlyingStartTankCollection added, etc., ver. 2.18.1040 2018-10-24 13:18:38 +02:00
Milan Hanajik 0db7736247 Minor fix in TestMethods.FlyingStart.FlyingStartSeq. 2018-10-23 19:45:53 +02:00
Milan Hanajik 02cebe0966 CEVAK 200 Elde component upgraded: 23.10.2018, I4 and I5 fixed. 2018-10-23 13:13:26 +02:00
Milan Hanajik 4f2bb6291f Strings, ver. 2.18.1036 2018-10-21 10:58:38 +02:00
Milan Hanajik 498c8afbe4 ver. 2.18.1035 2018-10-18 12:57:09 +02:00
Milan Hanajik 0e6dce4750 Error limits before Q2 correction are not shifted to target, factor 1.0 used for Q2CorrType.RL and Q2CorrType.LR, ver. 2.18.1034 2018-10-18 09:28:35 +02:00
Milan Hanajik 7a74579c8b Q2 correction RL and LR addresses swapped, Q2 correction value multiplied by 0.5, ver. 2.18.1033 2018-10-17 14:41:07 +02:00
Milan Hanajik c23630a980 Separate addresses Q2CorrFactorsAddrRL (0x1878) and Q2CorrFactorsAddrLR (0x1879), ver. 2.18.1031 2018-10-17 11:31:28 +02:00
Milan Hanajik 205df83c1c Test sequences modified, Q2CorrRFlow and Q2CorrLFlow set in iPerlCommunicationForm only, ver. 2.18.1030 2018-10-17 09:56:01 +02:00
Milan Hanajik b26f65dab4 (1) Diverter : Fixed 'flowMtrNr4Cmd' for FUZHOU_100, (2) SendCalibData(..., MeretModbus=0xff), ver. 2.18.1029 2018-10-16 10:22:04 +02:00
Milan Hanajik 8d1ac8f41d (1) 'Max_test_index' added to Results, (2) "Max.test index" added to BenchInfoEx, (3) ResultsTabPageCtrl draws NOK wm-s with max. test index in 'Orange', (4) bug fix in ProductionTracing simulation, ver. 2.18.1027 2018-10-15 14:42:17 +02:00
Milan Hanajik 115916fd36 ver. 2.18.1026 2018-10-15 13:20:36 +02:00
Milan Hanajik 6641ed9d96 Bug fix in iPerlHead.CalibTarget property, ver. 2.18.1025 2018-10-15 13:09:30 +02:00
Milan Hanajik 5e3d408706 IsRemoteDBCompatible( ) copes with no remote DB connection, ver. 2.18.1024 2018-10-14 21:58:40 +02:00
Milan Hanajik 8fc9e3e5ce On screen results arrangement : MinWidth, MinHeight. 2018-10-13 06:24:20 +02:00
Milan Hanajik e7aa9731d0 (1) DataEntry.Std6,12,24,48: Excl. mark behaviour, (2) Kepno component upgraded (12.10.2018), (3) TestMet.PulsesTest: OK btn removed, ver. 2.18.1023 2018-10-12 16:04:06 +02:00
Milan Hanajik 0fc63655e9 iPerlHead modification : 'nominalTestFlowLph' calculated from q2adjTestData, test method sequences simplified, ver. 2.18.1021 2018-10-12 13:25:21 +02:00
Milan Hanajik 86b47cb434 ProcedureDlg : History TAB in progress. 2018-10-11 13:53:24 +02:00
Milan Hanajik b3ec97d95c TestMethods.SensitivityTest : Clean-up, in progress. 2018-10-11 11:06:51 +02:00
Milan Hanajik 1620758545 E1 error indicator modified, average flow calculated from CTV volume and test time verified, ver. 2.18.1019 2018-10-11 10:58:08 +02:00
Milan Hanajik 5a2d51db95 Statistics.Start( ) has argument 'skippedsamplesCount', constructor sets 'DefaultSkippedSamplesCount', all FixedStart methods use Math.Max(5, (int)(TstTime/10)), other methods 0, ver. 2.18.1018 2018-10-11 10:26:02 +02:00
Milan Hanajik c0e99364a4 Result, Test passed and Test done items can be formatted, PassedColorStr( ) has argument 'yesNoFormatOrEmpty', ver. 2.18.1017 2018-10-10 11:13:08 +02:00
Milan Hanajik 371a27c646 Output.FileWriters.IperlLogger.Write bug fix : Qfrom, Qto etc. were missing, ver. 2.18.1016 2018-10-10 08:59:35 +02:00
Milan Hanajik 4a06dcff3e (1) TestMethods.PulsesTest : modeless form closed at the end of test, (2) TestMethods.PulsesTestManual : fixes in form items visibility, ver. 2.18.1015 2018-10-09 13:54:36 +02:00
Milan Hanajik 0f54bf86ac ver. 2.18.1014 2018-10-08 11:39:12 +02:00
Milan Hanajik 921c524f0e Output.FileWriters.IperlLogger.Writer : Bug fixed, data of wm0 were logged for all water meters in the batch, ver. 2.18.1013 2018-10-08 11:00:18 +02:00
Milan Hanajik a8df9b50de (1) SLM_END Elde comp. updated (03.10.2018), (2) Elde.TempMeterMeret component added, (3) MeretRS485Address array size increased for 2 new Meret temp.meters for SLM_END, ver. 2.18.1012 2018-10-05 11:34:34 +02:00
Milan Hanajik 5da9b1e94e Fixed a bug when adding a list of new components using a script file, ver. 2.18.1010 2018-10-03 14:56:42 +02:00
Milan Hanajik 63871c9bcc Changes for IZRAEL_50, DEWA_50 removed (replaced by FEWA_50) 2018-10-03 14:56:30 +02:00
Milan Hanajik e5b61825ff Ultrasound level meter modbus communication completed. 2018-10-01 16:40:42 +02:00
Milan Hanajik 2d484ea993 TBF.BenchControl.Configs.ParamsProvider.ComponentCfgCtrl displays a message box when a parameter is invalid, ver. 2.18.1010 2018-10-01 11:18:35 +02:00
Milan Hanajik b5b7d50742 TestiInfo for Greece added (Q1Q2Q2adjQ3), minor fix in SensusOracle.Database, ver. 2.18.1009 2018-10-01 09:01:36 +02:00
Milan Hanajik 19d77a9ad9 SENTEC : FlyingStartMassCollectionSeq : Tank draining is completed before the flow control starts (as in Berlin). 2018-09-28 14:16:12 +02:00
Milan Hanajik e77c0460de UltrasoundLevelMeter parent name is 'Modbus' only. 2018-09-27 15:20:34 +02:00
Milan Hanajik 2ad5843f4f Cleanup: bool Output.SensusTestInfo.AreCompatible(.,. ) introduced, etc, ver. 2.18.1008 2018-09-27 15:02:36 +02:00
Milan Hanajik 631ef5fe20 SensusOracle.Database : Bug fix in TestInfo comparison, Qbz. Just == Just1 allowed now, ver. 2.18.1007 2018-09-25 16:36:43 +02:00
Milan Hanajik cd246e89c8 RequiredGroupMembership: Users.Grp.GID --> Users.Grp.GID[] (initial version), ver. 2.18.1006 2018-09-25 09:05:51 +02:00
Milan Hanajik 438374532f BatchResults.IsProduction( ) modified, ver. 2.18.1005 2018-09-24 13:06:01 +02:00
Milan Hanajik 92609b9ead iPerl CalibrationStructV4 related stuff added, ver. 2.18.1004 2018-09-24 10:06:19 +02:00
Milan Hanajik 07b51f12a2 Prevent SW crash in bool Results.Output.Printers.Table.IsEmpty( ) 2018-09-20 12:23:24 +02:00
Milan Hanajik 16494389c6 ver. 2.18.1001 2018-09-20 08:24:05 +02:00
Milan Hanajik be86f0278f FEWA_50 component added, FEWA_50 define processing added, ver. 2.18.1000 2018-09-19 12:17:38 +02:00
Milan Hanajik 7e7ae86f65 iPerlHead : 'LogType' procedure parameter added and used when creating 'optoDataLogFileName'. 2018-09-19 11:14:10 +02:00
Milan Hanajik 3b2139d3df (1) Output.FileWriters.IperlLogger uses definitions stored in Output.SensusTestInfo objects, (2) sensusOracle.Database OK for Suez, searches for appropriate SensusTestInfo-s. 2018-09-19 11:10:48 +02:00
Milan Hanajik 16c59b5c47 (1) MessageBoxOp, AskYesNoOp and CoverTest do not use Bridge.OnCloseQandAForm, (2) ChangeOfFlowDirection --> ChangeFlowDirection, (3) code cleanup, 2018-09-18 16:44:32 +02:00
Milan Hanajik 49cc584914 (1) Closing iPerlCommunicationForm fixed once again, (2) Czech translations fixed. 2018-09-18 15:24:33 +02:00
Milan Hanajik aeefac1d4e iPerlCommunication activity "Write Q2 correction R-L" and "Write Q2 correction L-R" added, ver. 2.18.999 2018-09-17 14:16:40 +02:00
Milan Hanajik 2b30607d9c ver. 2.18.998 2018-09-17 12:46:11 +02:00
Milan Hanajik cef8d3ff95 Stubs of Hart.Common and Hart.Nivotrack components added. 2018-09-14 12:13:15 +02:00
Milan Hanajik 64646486e9 All DataEntry forms bug fix : PurchaseOrder of water meters is updated only when a form was closed by OK, ver. 2.18.997 2018-09-14 09:52:11 +02:00
Milan Hanajik 769e68d49b Output.Printers.Enhanced : "Nr. of copies' option added, ver. 2.18.996 2018-09-14 09:02:21 +02:00
Milan Hanajik 3dcb134aa1 Output.Printers.Enhanced : 'Good only' option fixed. 2018-09-14 08:27:12 +02:00
Milan Hanajik 81cb0eae64 Results.ItemID : Procedure_description, Test_bench_name, Address1-5 and respective WMeterRsltItemSpec added, ver. 2.18.995 2018-09-14 08:25:22 +02:00
Milan Hanajik 4fad9925ec ResultsBrowser: CEVAK specific code commented out, ver. 2.18.995 2018-09-13 17:56:02 +02:00
Milan Hanajik 92d246eda0 TBF : Processing keys in MainWnd disabled for CEVAK_200 2018-09-13 17:54:03 +02:00
Milan Hanajik 34479778b9 CEVAK_40, FUZHOU_50/_100/_150/_300, MURES_40, PUCHONG_200, TORINO_50, TORUN_50 introduced, ver. 2.18.995 2018-09-13 14:17:03 +02:00
Milan Hanajik 163d209071 TBF bug fixes : (1) RegulValve adcChannel for CEVAK, (2) ComponentsManagerDlg columns. 2018-09-13 12:49:31 +02:00
Milan Hanajik 8eb601f24d UltrasoundLevelMeter component added. 2018-09-13 12:48:09 +02:00
Milan Hanajik ac9407b59d TestMethods.PulsesTestManual added, ver. 2.18.994 2018-09-13 09:02:24 +02:00
Milan Hanajik 00dd0ed8fd Output.FileWriters.IperlLogger modifications : LogType.DEWA added. 2018-09-12 13:30:39 +02:00
Milan Hanajik 6a53417b62 TBF : (1) SensusOracle component moved from DB to Output.DB, (2) Output.SensusCommon class, (3) Output.SensusTestInfo class. 2018-09-11 14:03:05 +02:00
Milan Hanajik 90f2b83fc0 iPerlCommunicationForm : Fixed closing the form when editing check boxes. 2018-09-11 11:31:00 +02:00
Milan Hanajik 3382c6e77a (1) Output.FileWriters.IperlLogger configuration for LogType.Suez, (2) DB.SensusOracle Quality DB + dead code/parameters cleanup, ver. 2.18.993 2018-09-11 11:30:08 +02:00
Milan Hanajik 072de642e1 ComponentsManagerDlg : Components sorting controlled by click-able column headers. 2018-09-10 12:28:53 +02:00
Milan Hanajik 489ebd04aa TestMethods.ChangeOfFlowDirection added. 2018-09-10 10:06:31 +02:00
Milan Hanajik 2a68934b0e More logging in all Output.FileWriters, ver. 2.18.992 2018-09-07 12:40:32 +02:00
Milan Hanajik f3a502b7df iPerlCommunicationForm : minimizing, maximizing and closing this form is disabled, ver. 2.18.992 2018-09-07 10:18:32 +02:00
Milan Hanajik 2b0e66c71d MessageBoxOp : Form has a windows title so that it can be moved. 2018-09-06 17:16:22 +02:00
Milan Hanajik e5c01a14d9 Bug fix in last graphs batch numbers. 2018-09-06 16:52:11 +02:00
Milan Hanajik e5ef10beac Bug fix in ErrorFlags evaluation. 2018-09-06 15:49:10 +02:00
Milan Hanajik 4c3c499ad5 Output.FileWriters.IperlLogger component added (generalized, loop over tests), ver. 2.18.990 2018-09-06 15:48:39 +02:00
Milan Hanajik bdc7f5abd8 RoiDetectionSeq : More logging (display) 2018-09-06 15:25:48 +02:00
Milan Hanajik 0ff78b9d4c (1) Multiple instances of SensusOracle.Database component possible, (2) Test.ItemNr updated properly, ver. 2.18.988 2018-09-04 13:48:50 +02:00
Milan Hanajik 41959d863f Changes for CEVAK PT200, ver. 2.18.986 2018-09-03 08:28:45 +02:00
Milan Hanajik e7d495e47d ver. 2.18.985 2018-08-31 14:16:08 +02:00
Milan Hanajik e4f5be3f41 iPerlCommunication : (1) Bug fix for iPerlSpecial, (2) Save button position, (3) Activity is a ComboBox, (4) DN is a ComboBox, ver. 2.18.984 2018-08-31 12:46:12 +02:00
Milan Hanajik f42c1b7f0c CEVAK PT200 component upgraded (initial version dated 30.08.2018). 2018-08-30 14:13:31 +02:00
Milan Hanajik 9dbca87429 Copying users from a remote database fixed (UI) and done as a database transaction, ver. 2.18.982 2018-08-30 14:11:40 +02:00
Milan Hanajik 49ae2a84c4 Remote DB : (1) Bug fix in DatabaseSettings.Clone(), (2) Compatibility check on startup. 2018-08-30 14:10:20 +02:00
Milan Hanajik 34073844bc Config.FluentCommon cleanup : SaveToDb( ) and DeleteFromDb( ) removed. 2018-08-30 08:04:19 +02:00
Milan Hanajik 6f3b9be77e TBF : LoginDlg displayed after a double-click on the status strip with current user name. 2018-08-28 13:11:55 +02:00
Milan Hanajik f675c7ada2 Output.DB.ProductionTracing.TracingDB : Workplace registration. 2018-08-28 13:10:31 +02:00
Milan Hanajik 6aee0a71ed TBF : Output.DB.ProductionMonitoring --> Output.DB.ProductionTracing. 2018-08-28 10:12:39 +02:00
Milan Hanajik fa818c5cf8 TracingDB : WorkplaceRegistration, etc. added, TrivialLoginDlg removed, ver. 1.5.61 --> 2.0.65 2018-08-28 09:58:58 +02:00
Milan Hanajik 0ef9505af1 MonitoringDB --> TracingDB, TBF ver. 2.18.981 2018-08-28 09:44:39 +02:00
Milan Hanajik bf69524fd8 TBF : (1) Elde.RegisterReader has a new proc. parameter int Filter, (2) Filters 'int[]' are passed everywhere in the TBF application istead of test.TolerRed. 2018-08-23 12:45:13 +02:00
Milan Hanajik 58df07300e TestMethods.GenesisHead and TestMethods.GenHead folders added. 2018-08-22 18:48:37 +02:00
Milan Hanajik bef4928162 Genesis : (1) component upgraded (dated 22.08.18), (2) bug fixes, ver. 2.18.980
more
2018-08-22 18:46:17 +02:00
Milan Hanajik 5995204d8d ver. 2.18.979 2018-08-22 08:36:32 +02:00
Milan Hanajik 69b7c94176 Users.Forms.UserManagementDlg : Sorting by data in columns including a surname, ver. 2.18.981 2018-08-14 14:37:15 +02:00
Milan Hanajik 540bc8ca74 ver. 2.18.979 2018-08-08 11:34:17 +02:00
Milan Hanajik 03920d5b90 ver. 2.18.978 2018-08-06 15:59:58 +02:00
Milan Hanajik 765637ce2d TestMethods.PulsesTest : (1) Fixes in forms, (2) MinPulsesCount test parameter introduced, ver. 2.18.977 2018-08-03 11:16:13 +02:00
Milan Hanajik b4596ae6e9 User.Grp.GID.TracabilityManagement user level added for TYRA_IPERL only. 2018-08-03 08:08:14 +02:00
Milan Hanajik 4c92cb7af0 MonitoringDB merged with ProductionTracing, ver. 1.5.61 2018-08-02 13:41:10 +02:00
Milan Hanajik 770b8447ac Default connection string for central DB of users updated. 2018-08-02 13:41:09 +02:00
Milan Hanajik f3532fc3cb Unnecessary references removed, ver. 2.18.976 2018-07-30 09:31:45 +02:00
Milan Hanajik a7cfbc0b76 Fuzhou 100 component updated : Initial version dated 25.07.2018 2018-07-25 15:13:56 +02:00
Milan Hanajik 608dd087b8 Sequences.Statistics.ApplyFilter() cleanup, ver. 2.18.975 2018-07-23 16:02:02 +02:00
Milan Hanajik 5d2871b9ed PulsesTest : Puses count = '---' and rectangles are red on startup. 2018-07-19 17:29:43 +02:00
Milan Hanajik 779c870613 Comparison (VolumeMaster == 0) done when calculating Constmaster in all mass based methods, ver. 2.18.972 2018-07-19 13:20:48 +02:00
Milan Hanajik 3cd585fe41 Modbus.CometAmbient.Ambient comments only. 2018-07-19 11:03:28 +02:00
Milan Hanajik ff27ae7635 ver. 2.18.971 2018-07-18 17:43:17 +02:00
Milan Hanajik a41e805e8d DUBAJ_50 and CEVAK_200 added, ver. 2.18.970 2018-07-18 17:27:42 +02:00
Milan Hanajik 9bcf3aa7f6 TestMethods.PulsesTest : Texts in forms fixed. 2018-07-18 16:31:55 +02:00
Milan Hanajik ff2248720c TestMethods.PulsesTest added. 2018-07-18 10:00:37 +02:00
Milan Hanajik 9bd2cd2634 Error message after a wrong test or procedure parameter, ver. 2.18.969 2018-07-17 12:16:52 +02:00
Milan Hanajik 9ba1b58d2e CombinedWithDetTestParams.OffsetPulsesFreq parameter introduced, use in Qfall detection, ver. 2.18.968 2018-07-17 10:53:34 +02:00
Milan Hanajik 1d8728c7ce TURA_SPECIAL : 'Stop draining' in BenchControlPanel is not protected by a password, ver. 2.18.967 2018-07-16 15:56:03 +02:00
Milan Hanajik af68f35400 (1) ComponentsManagerDlg displays all components that failed to load, (2) Diverter.divNrFromName fixed for Berlin (DivEx), ver. 2.18.966 2018-07-16 15:05:06 +02:00
Milan Hanajik de269b66b5 IPumpFM handling : bug fix in SequenceBase. 2018-07-16 09:51:01 +02:00
Milan Hanajik ea894c2db5 upgradeDb_2018_2019-Button --> upgradeDb_218_220_Button. 2018-07-13 13:04:22 +02:00
Milan Hanajik bd9785c195 TestRslt.ConstMasterCorr and Results.ItemID.Reference_error_corr introduced and calculated in all test methods. 2018-07-13 13:00:03 +02:00
Milan Hanajik 044046080d IPumpFM handling modifications, ver. 2.18.962 2018-07-12 15:59:09 +02:00
Milan Hanajik 04efa02089 Diverter threshold levels sent by SendCalibData(...) fixed, ver. 2.18.961 2018-07-11 21:48:42 +02:00
Milan Hanajik 426a21fd0b ver. 2.18.960 2018-07-11 11:49:35 +02:00
Milan Hanajik 8523324962 FUZHOU100 symbol added, Fuzhou PT100 component added, ver. 2.18.959 2018-07-11 11:33:01 +02:00
Milan Hanajik f06f819adb E9 and E12 ErrorFlags modifed : Offset parameters added, ver. 2.18.957 2018-06-28 17:01:57 +02:00
Milan Hanajik ac8e766476 ver. 2.18.956 2018-06-28 11:09:29 +02:00
Milan Hanajik a67a709782 (1) Fixes in Screens.ProcessTabPageXY, (2) Program can be closed when there is a red error message, ver. 2.18.955 2018-06-27 11:45:54 +02:00
Milan Hanajik 9543de4170 UiCmdStop in CombinedWithDetectionSeq when flow is not reached (timeout), German error message, ver. 2.18.954 2018-06-27 10:31:22 +02:00
Milan Hanajik 79fea707f3 (1) Munich component upgraded - coax valve bug, (2) DivSamples array size fixed for MUNICH, ver. 2.18.952 2018-06-27 08:34:18 +02:00
Milan Hanajik 1034c8e752 Bug fix in Elde.RegulValveCoax.SetFlowOp and Elde.StartMeasurementOp, more logging. 2018-06-27 08:31:58 +02:00
Milan Hanajik aa95f60a81 SENTEC: StateMachine.Period = 1s again, ver. 2.18.941 2018-06-22 15:07:22 +02:00
Milan Hanajik 420cf6397b ver. 2.18.940 2018-06-22 13:39:58 +02:00
Milan Hanajik fce2fcf293 (1) Bug fixes in Results.ItemID.Flow_ctv and Strings.Tooltip_Q_v_r, (2) FileWriters.Enhanced modification for CSV-format, ver. 2.18.939 2018-06-22 13:30:17 +02:00
Milan Hanajik 41c662f053 Use of remote database for procedures/tests, part 3, ver. 2.18.938 2018-06-21 13:45:50 +02:00
Milan Hanajik 72d2b602ab ver. 2.18.937 2018-06-21 13:42:20 +02:00
Milan Hanajik dc08f308d0 ver. 2.18.936 2018-06-20 14:39:39 +02:00
Milan Hanajik 910f15dfbf ver. 2.18.935 2018-06-20 11:31:22 +02:00
Milan Hanajik d4f8c23cce ver. 2.18.934 2018-06-20 11:24:34 +02:00
Milan Hanajik 324be83f9b Bug fix in diverter. 2018-06-20 11:02:16 +02:00
Milan Hanajik ea8d4cb63d Petersburg components updated (20.06.2018). 2018-06-20 10:38:15 +02:00
Milan Hanajik 7b5231af80 GraphLib : (1) Playback removed, (2) Precision timer removed. 2018-06-20 10:38:14 +02:00
Milan Hanajik 63b7b83363 Refactoring, clean-up, comments, fix in control preventing MainWnd designer to open, ver. 2.18.933 2018-06-20 10:36:52 +02:00
Milan Hanajik 7a814c2a00 Bug fix in TBF.BenchControl.Sequences.SequenceBase.Transition(...), ver. 2.18.931 2018-06-19 13:48:56 +02:00
Milan Hanajik 76053d466b Use of remote database for procedures/tests, part 2. 2018-06-19 09:25:24 +02:00
Milan Hanajik 6020d6e4eb BenchInfo.Polska removed (replaced by BenchInfo.Extended). 2018-06-19 09:24:26 +02:00
Milan Hanajik 61d06dc910 BenchInfo.Extended.Component added, generic BenchControl.Configs.ParamsProvider.ComponentCfgCtrl added. 2018-06-18 17:13:13 +02:00
Milan Hanajik e889215cf4 IParamsProvider.UpdateParam(...) returns CfgUpdateFlags now. 2018-06-18 16:45:32 +02:00
Milan Hanajik cdc971f733 public enum CfgUpdateFlags moved to Config.Enums 2018-06-18 14:44:52 +02:00
Milan Hanajik 863856d27d ComponentCfgBase and derived classes : portected XmlSerializer GetSerializer() --> public XmlSerializer GetSerializer(). 2018-06-18 12:44:37 +02:00
Milan Hanajik cf5dd8cb71 Sharing procedures from a remote DB, ver. 2.18.928 2018-06-15 14:31:40 +02:00
Milan Hanajik 619c06a511 SENTEC: StateMachine.Period = 2s, ver. 2.18.927 2018-06-15 08:57:11 +02:00
Milan Hanajik 9b85630405 ver. 2.18.926 2018-06-14 13:58:36 +02:00
Milan Hanajik 078dc08ed0 Test name cannot contain characters \ / : * ? " < > | (like a file name), ver. 2.18.925 2018-06-14 13:56:43 +02:00
Milan Hanajik f82658cee2 (1) diverter fixed for Badger-velka-trat, (2) power user 'leos' deleted, ver. 2.18.923 2018-06-13 07:35:47 +02:00
Milan Hanajik 7c2135a8fe Bug fixes in reading diverters: ReadDiverterTransitionOp, Elde.Diverter.Component, IControlCOm, IDiverter. 2018-06-12 17:07:15 +02:00
Milan Hanajik b5383a445e Preparation for remote sharing of procedures, ver. 2.18.920 2018-06-11 12:53:52 +02:00
Milan Hanajik f3c0da79e8 (1) Graphs : DivSamples on test START and END, (2) div. transition times calculated from samples. 2018-06-11 12:52:08 +02:00
Milan Hanajik c4c221f58c TestRslt.IsRelErrTest() / IsPMaxTest() / IsStartStop() / IsDiverter() modified and used differently in WMeterRsltItemSpec, ver. 2.18.917 2018-06-08 09:56:52 +02:00
Milan Hanajik 2a622d4aa2 RegisterReaders.SerialStream : Bug fix in DatastreamFrame in case of TiemFieldFormat == FieldFormat.None, ver. 2.18.916 2018-06-06 11:18:30 +02:00
Milan Hanajik baa67cfe02 Change in MainSeq reverted so that transition sequence after test is executed on Stop. ver. 2.18.915 2018-06-06 09:50:52 +02:00
Milan Hanajik d0cddd072c (1) Timeout when setting flow handled as UiCmdStop, (2) RegValve.SetFlowOp cleanup, (3) minor change in RegReaders.SerStream, ver. 2.18.914 2018-06-05 14:21:03 +02:00
Milan Hanajik e20a95029c Bug in UI in ProcedureDlg when the last test is deleted fixed, ver. 2.18.913 2018-06-04 13:53:06 +02:00
Milan Hanajik 392a02b83c (1) IDatastreamReader iface in IperlHead and SerialStream, (2) SerialStream buffer size, (3) TimeFieldFormat==FieldFormat.None implemented, ver. 2.18.911 2018-06-04 08:15:27 +02:00
Milan Hanajik 385825c9e8 Progress bar bug fix for repeated tests. 2018-06-01 13:58:59 +02:00
Milan Hanajik acb5491225 DatastreamFrame logging fixed, FrameFormat handling improved, PD log file names fixed, ver. 2.18.910 2018-06-01 13:21:11 +02:00
Milan Hanajik 5d4dedcb25 RegisterReaders.SerialStream component added, to be tested, ver. 2.18.909 2018-06-01 09:52:24 +02:00
Milan Hanajik 775af25d1b Clean-up, more comments. 2018-05-31 19:04:01 +02:00
Milan Hanajik c4e4bb2e77 SENTEC component upgraded (30.05.2018), ver. 2.18.907 2018-05-30 18:28:16 +02:00
Milan Hanajik 7e2781148e MettlerToledo.Standard : EmptyUp parameter added, used in IsEmpty(.), etc. 2018-05-30 12:57:11 +02:00
Milan Hanajik dd851fb344 (1) SENTEC component (24.05.18), (2) SENTEC defines, (3) RegulValve modified for SENTEC, (4) message box shown in case of a fatal error on start-up, ver. 2.18.906 2018-05-30 12:56:45 +02:00
Milan Hanajik 531a728b37 ver. 2.18.904 2018-05-25 09:04:11 +02:00
Milan Hanajik f10c5797bb ver. 2.18.903 2018-05-25 08:48:47 +02:00
Milan Hanajik 052f39d330 (1) ProcedureDlg and TestParamsCtrl improvements and cleanup, (2) related changes in test methods, ver. 2.18.902 2018-05-24 13:20:03 +02:00
Milan Hanajik 2e593d11eb (1) Results are redrawn when iPerlCommForm is closed, (2) 'Stop draining' is password protected, (3) PW-s updated, ver. 2.18.901 2018-05-21 16:45:54 +02:00
Milan Hanajik e150624f4d Bug fixes in DataEntry.Standard6.TestStartEndForm, more logging, ver. 2.18.899 2018-05-18 16:30:59 +02:00
Milan Hanajik ca9d83e424 ver. 2.18.898 2018-05-18 10:57:17 +02:00
Milan Hanajik 3b1544b330 ver. 2.18.897 2018-05-18 09:58:49 +02:00
Milan Hanajik 518a1f792c Heat meters fixes. 2018-05-18 08:33:45 +02:00
Milan Hanajik 2f3b09ffc5 UpgradeSelectionDlg : (1) upgradeDb_NFC_button_Click( ) added, (2) upgradeDb_218_219_Button_Click( ) completed, ver. 2.18.896 2018-05-17 17:22:50 +02:00
Milan Hanajik d9c60584eb Smart card reader detection embedded inside try { ... } catch( ), ver. 2.18.895 2018-05-17 11:06:57 +02:00
Milan Hanajik d8e0772a0f ZAMBIA define and packages/ControlBoard/Zambia/... component added, ver. 2.18.894 2018-05-17 09:00:08 +02:00
Milan Hanajik 875caf0e28 (1) Smart card reader support, (2) Tag added to User DB table, (3) Graphs : Y-label fixed, two significant digits, ver. 2.18.893 2018-05-15 17:37:05 +02:00
Milan Hanajik 86601e1ba1 BugFix in ...Elde.StartMeasurementOp for the case of RV=...Elde.RegulValveCoax.RegulValve 2018-05-14 16:03:02 +02:00
Milan Hanajik 67a762e51c MettlerToledo.Standard : Timeout in ReadMassOp and ReadStableMassOp, ver. 2.18.892 2018-05-14 10:41:03 +02:00
Milan Hanajik d6881bfdf3 (1) ParamsProvider-s added to C..Test/C..Procedure entities, (2) ComponentCfgBase fn-s returning IParamsProvider rewritten, (3) refactoring, ver. 2.18.891 2018-05-11 16:51:07 +02:00
Milan Hanajik 878c89591e Bug fixes: (1) in MainWnd when proc. added to empty DB, (2) in TestParamsCtrl when a test added and moved up, (3) other minor, (4) ItemNr of editted procedure displayed almost always, ver. 2.18.890 2018-05-02 15:52:53 +02:00
Milan Hanajik f332fd7141 FlyingStartMassCollection and FlyingStart : Case when there is one or no pulse from the water meter handled correctly. 2018-04-27 13:52:06 +02:00
Milan Hanajik bb3be1c649 Results.Entities.TestRslt.ConstMasterRaw added, set to outPath.FlowMeter.LtrPerPulse in sequences 2018-04-27 11:00:05 +02:00
Milan Hanajik e88175b349 (1) Output.DB.SaveFlowmeterCorrections: date, validity, certificate, (2) Flow_ctv, Flow_ctv_min, ... 2018-04-25 12:49:07 +02:00
Milan Hanajik c0f4c5acef (1) Multiple start valves, test methods modified, (2) Component for JuznaAfrika50 (25.04.2018), ver. 2.18.887 2018-04-25 12:47:33 +02:00
Milan Hanajik 1f9df9bb67 (1) Units : lpp,dm3pp,lpdeg,dm3pdeg added, (2) Bug fix in WMRsltItemSpec(ItemID.P_delta_mean_from_up_down_per_mtr, ... , ver. 2.18.884 2018-04-19 14:42:42 +02:00
Milan Hanajik de4a0c61b9 More italian, ver. 2.18.882 2018-04-18 11:34:15 +02:00
Milan Hanajik 0f3f54f8d0 ver. 2.18.881 2018-04-17 23:49:36 +02:00
Milan Hanajik 60f7fbe4c3 More logging, Italian, quantities with units in many languages, etc., ver. 2.18.880 2018-04-17 23:28:00 +02:00
Milan Hanajik 37e84ee678 SMAT Torino PT50 component upgraded (17.04.2018). 2018-04-17 23:19:41 +02:00
Milan Hanajik 04878cea50 Config.Entities.Medium : ToDescription() used in UI, Strings.cold/hot removed, gorjaca->ciepla, ver.2.19.879 2018-04-17 09:04:32 +02:00
Milan Hanajik 7c940bd633 ver. 2.18.878 2018-04-16 15:53:42 +02:00
Milan Hanajik 5769b6ad48 Bug fixes: (1) OnePerMeter : 'WaterMeters[0]' used instead of 'wm', (2) Printers.Table : last vertical line, ver. 2.18.877 2018-04-15 12:19:06 +02:00
Milan Hanajik b17d710044 Results.Entities.WaterMetrData.Medium added, woda zimna/goraca, ver. 2.18.876 2018-04-15 11:34:07 +02:00
Milan Hanajik 441601bd42 iPerl : Default calibration factors modified, ver. 2.18.875 2018-04-12 15:46:12 +02:00
Milan Hanajik d1f5bd8300 New result items, tau_ss fixed (Kepno). 2018-04-12 14:27:13 +02:00
Milan Hanajik 98c1194e5b Bug fix in Sequences.MainSeq.RestoreBatchResults. 2018-04-12 12:42:11 +02:00
Milan Hanajik 85f2f31469 (1) Output.Printers.OnePerMeter : Table{s} centered horizontally on pages, (2) Indicators for PL: "brak" 2018-04-11 15:09:58 +02:00
Milan Hanajik fe3867bc5c ver. 2.18.872 2018-04-11 14:14:32 +02:00
Milan Hanajik b2e467714e Output.Priters.OnePerMeter : 2ng page table position fixed. 2018-04-11 13:50:01 +02:00
Milan Hanajik 0993716c8e (1) TBF.BenchControl.Formulas --> Config.Formulas, (2) MeterTestRslt.RegReaderType, (3) Rslt.items added, (4) Quantity.Pulses, ver. 2.18.870 2018-04-11 11:11:45 +02:00
Milan Hanajik c19802fa13 UpgradeSelectionDlg : upgradeDb_218_219_Button added. 2018-04-11 09:00:44 +02:00
Milan Hanajik efa5084d8b Results.Output.Printers.Table supports separator row line (TODO: separator column line). 2018-04-09 17:43:08 +02:00
Milan Hanajik 673e04a1b6 Renamed: Reference_pulses --> Reference_pulses_ni, Added: Reference_pulses, Test_time_ni, Separator. 2018-04-09 16:40:14 +02:00
Milan Hanajik a4a589a40c Cleanup : Results/ItemSpec, ResultsPrinters/Cevak/... removed, etc., ver. 2.18.869 2018-04-09 13:44:28 +02:00
Milan Hanajik 0436906a59 Elde.StopPreviousOp modified : STOP command resent if necessary, ver. 2.18.868 2018-04-09 10:59:40 +02:00
Milan Hanajik f2a3c47cf7 WMeterRsltItemSpec and Units modified (Kepno), ver. 2.18.867 2018-04-04 16:00:50 +02:00
Milan Hanajik 80db263929 (1) Printers.OnePerMeter with 3 columns above and below the body, (2) static Table Create_xy(...) introduced, ver. 2.18.866 2018-04-04 13:56:23 +02:00
Milan Hanajik 701c2f33bb ErrorFlagsEx water meter results item, ver. 2.18.864 2018-03-28 16:58:36 +02:00
Milan Hanajik dd8dce1d59 try { ... } catch when copying images. 2018-03-28 13:40:02 +02:00
Milan Hanajik cd1bee1018 IControlCom : Interface uses uint[8] filterConstants (Juzna Afrika, Genesis), ver. 2.18.861 2018-03-27 13:16:54 +02:00
Milan Hanajik 3f9312a606 ver. 2.18.860 2018-03-26 16:19:06 +02:00
Milan Hanajik f2c7b9904b ver. 2.18.859 2018-03-26 16:04:25 +02:00
Milan Hanajik 9ac7f691e0 iPerlCommunicationForm bug fix, ver. 2.18.858 2018-03-26 14:17:51 +02:00
Milan Hanajik bf1da91018 (1) Support for JUZNA_AFRIKA_50 symbol added, (2) Component JuznaAfrika50/ControlComponent3U added, ver. 2.18.857 2018-03-26 12:47:46 +02:00
Milan Hanajik 3f8fc9475a ver. 2.18.856 2018-03-26 10:57:59 +02:00
Milan Hanajik 72c3006c8a ResultsBrowser : Export of statistics, ver. 2.18.856 2018-03-25 21:55:18 +02:00
Milan Hanajik 5c8ebd6476 Output.Printers.Enhanced prints complete tables with vertical lines, multi-line support in tables, ver. 2.18.855 2018-03-23 12:08:58 +01:00
Milan Hanajik 2efdb8bb61 Bug fixes in FixedStartSeq, ver. 2.18.854 2018-03-23 08:37:33 +01:00
Milan Hanajik b9886599ed TestMethods.FixedStart added - uses only reference flowmeter, no scales, ver. 2.18.853 2018-03-22 21:03:13 +01:00
Milan Hanajik 570570570b ver. 2.18.852 2018-03-21 17:02:54 +01:00
Milan Hanajik 1593dc3070 ResultsBrowser : Any IResultsPrinter component from TBF can be used to print results, ver. 2.18.851 2018-03-20 04:49:11 +01:00
Milan Hanajik 9931138e5d (1) Minor improvements in Output.FileWriters.XmlBatch, (2) TestMethods.ReferenceFlowmeterCalibration removed, ver. 2.18.851 2018-03-20 01:40:58 +01:00
Milan Hanajik 91e7b95332 ver. 2.18.850 2018-03-19 11:41:05 +01:00
Milan Hanajik f912389a36 ver. 2.18.849 2018-03-19 09:44:50 +01:00
Milan Hanajik be5122cec6 Output.FileWriters.XmlBatch component added, ver. 2.18.848 2018-03-19 09:27:57 +01:00
Milan Hanajik 9f9883ac3e ResultsBrowser : UI for printer component OK, ver. 2.18.847 2018-03-19 08:52:02 +01:00
Milan Hanajik 5e50056f4a Output.DB.SaveFlowmeterCorrections tested and fixed, ver. 2.18.847 2018-03-19 06:31:30 +01:00
Milan Hanajik d97fa481c8 ver. 2.18.846 2018-03-18 14:18:28 +01:00
Milan Hanajik 495fb4e074 Bug fix in ProcedurePramsCtrl when Sick and ROI are combined and Sick is the 1st one, ver. 2.18.845 2018-03-17 06:53:27 +01:00
Milan Hanajik 82a1669306 ResultsBrowser : Inner exception message displayed, ver. 2.18.844 2018-03-16 13:24:38 +01:00
Milan Hanajik 0adec1cb51 Output.Printers.OnePerMeter : Table class added, common items use Table class for printing, ver. 2.18.844 2018-03-16 03:11:18 +01:00
Milan Hanajik f8a358c21e Diverter and flowmeter numbers for diverter tests corrected for 3 Fuzhou benches. 2018-03-16 03:08:50 +01:00
Milan Hanajik 6a40a351a7 Output.DB.SaveFlowmeterCorrections works well with tests when Repeats count > 1. 2018-03-15 05:59:22 +01:00
Milan Hanajik e8af9418bf Both login dialogs react on Enter key (moves focus). 2018-03-15 04:50:52 +01:00
Milan Hanajik 4245238112 UpgradeSelectionDlg fixed when no DB selected, etc., ver. 2.18.843 2018-03-15 03:42:19 +01:00
Milan Hanajik 88c92dd762 ver. 2.18.842 2018-03-14 12:53:14 +01:00
Milan Hanajik 6a38189ee2 (1) Change in FUZHOU300 #if/#else/#endif, (2) UpgradeSelectionDlg supports v.2.4 -> v.2.9. DB upgrade, ver. 2.18.841 2018-03-14 07:30:15 +01:00
Milan Hanajik 694e20c9b6 ver. 2.18.840 2018-03-14 02:18:42 +01:00
Milan Hanajik d0c27c4fe0 UpgradeSelectionDlg contains pressure representation upgrade, ver. 2.18.839 2018-03-13 07:49:06 +01:00
Milan Hanajik 82e71f6779 Components for all 3 test benches in Fuzhou upgraded. 2018-03-13 02:18:37 +01:00
Milan Hanajik ab6b96976c Changes in UpgradeSelectionDlg (database upgrade), ver. 2.18.838 2018-03-13 02:18:07 +01:00
Milan Hanajik 47c2184d5f Fixes in FUZOU_40 define, ver. 2.18.837 2018-03-12 00:19:27 +01:00
Milan Hanajik 04b0be79cd ver. 2.18.836 2018-03-11 12:30:31 +01:00
Milan Hanajik 9b212bd455 (1) MettlerToledo.Multi workaround for Badger-stredna-trat at the serial protocol level, (2) VB1 display fixed, ver. 2.18.835 2018-03-11 12:10:53 +01:00
Milan Hanajik 62b06b23a5 MettlerToledo.Multi workaround for Badger-stredna-trat, ver. 2.18.833 2018-03-09 17:29:13 +01:00
Milan Hanajik bbea6da45c Badger-streda-trat : zobrazenie prietoku zmenene na m3/h, ver. 2.18.832 2018-03-09 15:30:34 +01:00
Milan Hanajik 4452b62cbd Badger stredna trat : Flowmeter + diverter number when starting a test fixed, ver. 2.18.831 2018-03-09 12:25:58 +01:00
Milan Hanajik 4a7d14b01f U: leos, P: velka, ver. 2.18.829 2018-03-07 15:22:17 +01:00
Milan Hanajik 9ab78cf824 Changes for Badger: (1) numerical keys passed to Elde component, (2) Diverter# for Badger stredna trat, ver. 2.18.828 2018-03-07 14:43:57 +01:00
Milan Hanajik 615b3409be OnePerMeterPrintDocument changes. 2018-03-07 11:03:49 +01:00
Milan Hanajik 7465f23809 T_line_xy added to WMeterRsltItemSpec, ver. 2.18.827 2018-03-04 20:43:03 +01:00
Milan Hanajik 0598491753 SequenceBase.TestResult2CvsLine( ) bug fix, ver. 2.18.826 2018-02-26 20:40:19 +01:00
Milan Hanajik 88bf586da4 (3) Water density from air temperature uncorrected 2018-02-26 15:41:45 +01:00
Milan Hanajik 369753f94a (1) Water density calculated from temp. and pressure, (2) DensityOut -> DensityLine (mapped to DB column TestRslt.DensityOut), ver. 2.18.825 2018-02-26 15:30:22 +01:00
Milan Hanajik 29f79285a7 meterRslt.TestTime is read from board from cBrd.ImpulseTime(wmNr1) 2018-02-26 13:54:26 +01:00
Milan Hanajik 81951287c6 SequenceBase.TestResult2CsvLine( ) modified: isPressureTest, isStartStop, isDiverter, isCamera, ... 2018-02-26 13:13:36 +01:00
Milan Hanajik be86f791e4 TestRslt.MethodClass and MeterTestRslt.RegReaderClass fields set appropriately in each test, ver. 2.18.824 2018-02-26 12:35:53 +01:00
Milan Hanajik 4c70ac6412 MethodClass added to TestRslt, RegReaderClass added to MeterTestRslt, not mapped to DB. 2018-02-26 12:34:51 +01:00
Milan Hanajik d8de284c37 TestResults2CsvLine( ) clean-up.. 2018-02-26 09:34:50 +01:00
Milan Hanajik 39d43bc217 TestResult2CsvLine() modifications for Kepno, ver. 2.18.823 2018-02-23 10:03:23 +01:00
Milan Hanajik 7bb6d7f0e9 Water density calculation according to ITS-90 2018-02-23 09:55:19 +01:00
Milan Hanajik fc8bf749a4 (1) Network.Comet.Ambient clean-up, (2) Output.DB.SaveFlowmeterCorrections bug fix, ver. 2.18.822 2018-02-21 11:08:23 +01:00
Milan Hanajik 95a3d7def6 Network.Comet.Ambient component added, ver. 2.18.821 2018-02-20 19:30:05 +01:00
Milan Hanajik 1155cae130 iPerlCommunication bug fix (found on iPerlSpecial), ver. 2.18.820 2018-02-19 15:12:38 +01:00
Milan Hanajik f645aea402 ver. 2.18.819 2018-02-19 10:33:17 +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
2154 changed files with 245610 additions and 67496 deletions
+2
View File
@@ -0,0 +1,2 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
+15 -2
View File
@@ -1,15 +1,27 @@
Config/bin/
Config/obj/
Decrypt/bin/
Decrypt/obj/
DeviceTest/bin/
DeviceTest/obj/
Dirichlet.Numerics/bin
Dirichlet.Numerics/obj
Encrypt/bin/
Encrypt/obj/
GemCard/bin
GemCard/obj
GraphLib/bin
GraphLib/obj
TracingDB/bin
TracingDB/obj
Results/bin/
Results/obj/
ResultsBrowser/bin/
ResultsBrowser/obj/
TestBenchFramework/bin/
TestBenchFramework/obj/
Statistics/bin/
Statistics/obj/
TBF/bin/
TBF/obj/
TBFSetup/Debug/
TBFSetup/Release/
Users/bin/
@@ -17,5 +29,6 @@ Users/obj/
UserManagement/bin/
UserManagement/obj/
Doc/
.vs/
*.suo
*.bak
+11
View File
@@ -77,20 +77,26 @@
<Compile Include="Entities\IHasItemNr.cs" />
<Compile Include="Entities\IHasName.cs" />
<Compile Include="Entities\IHasValves.cs" />
<Compile Include="Entities\IParamsProvider.cs" />
<Compile Include="Entities\IperlEnums.cs" />
<Compile Include="Entities\MeasurementCorrection.cs" />
<Compile Include="Entities\MetersPath.cs" />
<Compile Include="Entities\OutputPath.cs" />
<Compile Include="Entities\Procedure.cs" />
<Compile Include="Entities\ProcedureHistory.cs" />
<Compile Include="Entities\Profile.cs" />
<Compile Include="Entities\PTest.cs" />
<Compile Include="Entities\Test.cs" />
<Compile Include="Entities\TransitionSequence.cs" />
<Compile Include="Entities\TransitionStep.cs" />
<Compile Include="Entities\Uncertainty.cs" />
<Compile Include="Entities\User.cs" />
<Compile Include="Entities\VirtualBenchSequence.cs" />
<Compile Include="Entities\VirtualBenchStep.cs" />
<Compile Include="Entities\Watermeter.cs" />
<Compile Include="Entities\WMType.cs" />
<Compile Include="FluentCommon.cs" />
<Compile Include="Formulas.cs" />
<Compile Include="Mappings\BenchPathMap.cs" />
<Compile Include="Mappings\ComponentMap.cs" />
<Compile Include="Mappings\ComponentProcedureMap.cs" />
@@ -102,9 +108,12 @@
<Compile Include="Mappings\MetersPathMap.cs" />
<Compile Include="Mappings\OutputPathMap.cs" />
<Compile Include="Mappings\ProcedureMap.cs" />
<Compile Include="Mappings\ProfileMap.cs" />
<Compile Include="Mappings\PTestMap.cs" />
<Compile Include="Mappings\TestMap.cs" />
<Compile Include="Mappings\TransitionSequenceMap.cs" />
<Compile Include="Mappings\TransitionStepMap.cs" />
<Compile Include="Mappings\UncertaintyMap.cs" />
<Compile Include="Mappings\UserMap.cs" />
<Compile Include="Mappings\VirtualBenchSequenceMap.cs" />
<Compile Include="Mappings\VirtualBenchStepMap.cs" />
@@ -117,10 +126,12 @@
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="Units.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.fr.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
+50 -10
View File
@@ -10,42 +10,78 @@ namespace Config
#if MUNICH
public const int WMsCount = 3;
public const int LineSize = 1;
public const int CompoundWMsCount = 1;
public const int LineSize = 3;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_VELKA_TRAT
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
#elif FUZHOU_300 || FUZHOU_150 || IZRAEL_200 || GENESIS || SLM_150 || PETERSBURG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif PUCHONG_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 || BERLIN
#elif DEWA_300 || ROMA_200
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif DUBAJ_50
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif IZRAEL_50
public const int WMsCount = 40;
public const int LineSize = 10;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_100
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || IZRAEL_25 || ZAMBIA || ZODINO || FEWA_50 || FILIPINY_50 || ALZIR_25
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 TURA_IPERL
#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 || TURA_IPERL_NEW
public const int WMsCount = 40;
public const int LineSize = 20;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TURA_SPECIAL
public const int WMsCount = 6;
#elif TURA_SPECIAL || SENTEC
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
@@ -74,5 +110,9 @@ namespace Config
/// Database related: This object reference is set after a successful user login
///
public static DatabaseSettings CurrentBench;
}
public static double RealDensity = 0; /// true water density [kg/m3]
public static double AtTemperature = 0; /// measured at temperature [°C]
public static double Buoyancy = 0;
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Config
result.IsRealBench = IsRealBench;
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
result.UsersDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
result.UsersDBSettings = (Users.DBSettings)UsersDBSettings.Clone();
return result;
}
+64 -1
View File
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
namespace Config.Entities
{
@@ -17,12 +18,16 @@ namespace Config.Entities
public virtual LogLevel Logging { get; set; }
public virtual string Parameters { get; set; }
public virtual IList<MeasurementCorrection> Corrections { get; set; }
public virtual IList<Uncertainty> Uncertainties { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Component()
{
Name = string.Empty;
ClassName = string.Empty;
Corrections = new List<MeasurementCorrection>();
Uncertainties = new List<Uncertainty>();
}
public static Component CreateFromCfg(string name, string className, string parentName, int itemNr,
@@ -53,6 +58,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;
@@ -70,5 +128,10 @@ namespace Config.Entities
return result;
}
public override string ToString()
{
return string.Format("{0} ({1})", Name, ClassName);
}
}
}
+28 -11
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
@@ -13,13 +13,25 @@ namespace Config.Entities
public virtual string Parameters { get; set; }
public virtual Procedure Procedure { get; set; }
IParamsProvider paramsProvider;
///
public virtual IParamsProvider GetParamsProvider() { return paramsProvider; }
public virtual void SetParamsProvider(IParamsProvider paramsProvider) { this.paramsProvider = paramsProvider; }
protected ComponentProcedure() { }
public ComponentProcedure(string name, string parameters, Procedure procedure)
{
this.CmpntName = name;
this.Parameters = parameters;
this.Procedure = procedure;
}
public virtual ComponentProcedure Clone(Procedure newProcedure)
{
ComponentProcedure result = new ComponentProcedure();
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Procedure = newProcedure;
return result;
return new ComponentProcedure(CmpntName, Parameters, newProcedure);
}
public virtual void Export(StreamWriter output)
@@ -34,11 +46,16 @@ namespace Config.Entities
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;
try
{
string cmptnName = firstLine;
string parameters = input.ReadLine().Replace("~", Environment.NewLine);
return new ComponentProcedure(cmptnName, parameters, newProcedure);
}
catch (Exception)
{
return null;
}
}
}
}
+28 -11
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
@@ -13,13 +13,25 @@ namespace Config.Entities
public virtual string Parameters { get; set; }
public virtual Test Test { get; set; }
IParamsProvider paramsProvider;
///
public virtual IParamsProvider GetParamsProvider() { return paramsProvider; }
public virtual void SetParamsProvider(IParamsProvider paramsProvider) { this.paramsProvider = paramsProvider; }
protected ComponentTest() { }
public ComponentTest(string name, string parameters, Test test)
{
this.CmpntName = name;
this.Parameters = parameters;
this.Test = test;
}
public virtual ComponentTest Clone()
{
ComponentTest result = new ComponentTest();
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Test = Test;
return result;
return new ComponentTest(CmpntName, Parameters, Test);
}
public virtual void Export(StreamWriter output)
@@ -34,11 +46,16 @@ namespace Config.Entities
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;
try
{
string cmptnName = firstLine;
string parameters = input.ReadLine().Replace("~", Environment.NewLine);
return new ComponentTest(cmptnName, parameters, newTest);
}
catch (Exception)
{
return null;
}
}
}
}
+345 -27
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -38,13 +38,68 @@ namespace Config.Entities
}
}
public enum ProcedureState
/// <summary>
/// Flags returned by each device configuration control Verify(...) function.
/// </summary>
public enum CfgUpdateFlags
{
None = 0,
Error = 0x1, /// Some settings in the user control are invalid and cannot be set
Warning = 0x02, /// Some settings in the user control are suspicious, can be set after user confirmation
RestartRqrd = 0x04, /// TBF program restart is required to apply all changed parameters
AnyChange = 0x08, /// At least one parameter have changed
VolatileChange = 0x10,
InvokeCfgChange = 0x20, /// Invoke CfgChange handler of the component
}
public enum RemoteDBUse
{
[Description("Local DB only")] LocalDBOnly,
[Description("Remote DB only")] RemoteDBOnly,
[Description("Both DB-s, local 1st")] BothDBsLocalFirst,
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst,
Count
}
/// <summary>
/// Contains a procedure name and a database specification (local/remote).
/// </summary>
public class ProcedureInfo
{
public readonly string Name;
public readonly Users.Entities.DBKind DBKind;
public ProcedureInfo(string name, Users.Entities.DBKind dbKind)
{
Name = name;
DBKind = dbKind;
}
}
public enum ProcedureState
{
Active,
History,
Count,
}
public enum ProfileType
{
Q3R,
QnClassColdWater,
QnClassHotWater,
QpQi,
Manual,
Count,
}
public enum ErrorLimitType
{
Manual,
QpClass,
Count,
}
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
@@ -52,12 +107,20 @@ namespace Config.Entities
[Description("Wasserzähler")] Single,
[Description("Verbundwasserzähler")] Combined,
[Description("Wärmezähler")] HeatMeter,
#elif LANG_FR
[Description("Compteurs eau")] Single,
[Description("Mètres composés")] Combined,
[Description("Thermomètres")] 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("Water meters")] Single,
[Description("Compound water meters")] Combined,
[Description("Heat meters")] HeatMeter,
#endif
@@ -76,22 +139,32 @@ namespace Config.Entities
public enum Medium
{
[Description("")] NotSpecified,
ColdWater,
HotWater,
[Description("")] NotSpecified,
#if LANG_PL
[Description("zimna")] ColdWater,
[Description("ciepła")] HotWater,
#elif LANG_IT
[Description("freddo")] ColdWater,
[Description("caldo")] HotWater,
#elif LANG_FR
[Description("eau froide")] ColdWater,
[Description("eau chaude")] HotWater,
#else
[Description("cold")] ColdWater,
[Description("hot")] HotWater,
#endif
Count
}
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
@@ -153,6 +226,17 @@ namespace Config.Entities
Count
}
/// <summary> Register reader type </summary>
public enum RegisterReaderType
{
Unknown,
Pulses, /// Sick, optical and similar
Camera, /// CLP1611
DataStream, /// iPerl
Manual, /// Entered by human via form (also from camera images)
Count
}
/// <summary> Transition step is finished when this condition is fulfilled </summary>
public enum StepCondition
{
@@ -164,6 +248,14 @@ namespace Config.Entities
Count
}
public enum MeretProtocol
{
[Description("<undefined>")] Undefined,
[Description("Meret (obsolete)")] Meret,
[Description("Modbus")] Modbus,
Count
}
public enum Publish : sbyte
{
#if LANG_DE
@@ -172,6 +264,11 @@ namespace Config.Entities
[Description("immer")] Always = 1,
[Description("Bildschirm")] OnScreen = 2,
[Description("intern")] Internal = 3,
#elif LANG_FR
[Description("jamais")] Never = 0,
[Description("toujours")] Always = 1,
[Description("À l'écran")] OnScreen = 2,
[Description("interne")] Internal = 3,
#elif LANG_CS
/// czech
[Description("nikdy")] Never = 0,
@@ -213,6 +310,10 @@ namespace Config.Entities
[Description("Waage")] Scale,
[Description("Spanne")] Spread,
[Description("Standardabw.")] StdDev,
#elif LANG_FR
[Description("Balance")] Scale,
[Description("Envergure")] Spread,
[Description("Déviation std.")] StdDev,
#elif LANG_CS
/// cesky
[Description("váhou")] Scale,
@@ -223,22 +324,16 @@ namespace Config.Entities
[Description("Spread")] Spread,
[Description("Std.dev.")] StdDev,
#endif
Count
Count
}
public enum TestRedType
public enum TestProfile
{
Fix,
/// etc.
Count,
}
public enum FQC1
{
FQC1,
FQP1,
Count,
}
UserDefined,
UserDefinedHeatMeter,
Protected, /// The first protected one
ProtectedHeatMeter,
}
public enum Progress
{
@@ -277,6 +372,14 @@ namespace Config.Entities
[Description("Prüfpunktergebnisse")] TestResult,
[Description("Wasserzelledaten")] MeterData,
[Description("Wasserzelleergebnisse")] MeterResult,
#elif LANG_FR
[Description("Autres")] Other,
[Description("Données de banc")] BenchData,
[Description("Résultats du banc")] BenchResult,
[Description("Données de test")] TestData,
[Description("Résultats de test")] TestResult,
[Description("Données du compteur d'eau")] MeterData,
[Description("Résultats du compteur d'eau")] MeterResult,
#else
[Description("Other")] Other,
[Description("Bench data")] BenchData,
@@ -286,7 +389,7 @@ namespace Config.Entities
[Description("Meter data")] MeterData,
[Description("Meter result")] MeterResult,
#endif
Count,
Count,
}
/// <summary> Possible modes of operation of components and devices. </summary>
@@ -303,6 +406,17 @@ namespace Config.Entities
[Description("Reply")] Reply,
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Geerbt")] Inherit,
#elif LANG_FR
[Description("Détection automatique: Éteindre")] DetectedOff = -2,
[Description("Détection automatique: Allumé")] DetectedOn = -1,
[Description("Ordinaire")] Normal = 0,
[Description("Détection automatique")] AutoDetect,
[Description("Erreur d'exécution")] FailureDuringOperation,
[Description("Éteindre")] Off,
[Description("Record")] Record,
[Description("Répondre")] Reply,
[Description("Simuler")] Simulate,
[Description("Hériter")] Inherit,
#else
[Description("Detected off")] DetectedOff = -2,
[Description("Detected on")] DetectedOn = -1,
@@ -315,7 +429,7 @@ namespace Config.Entities
[Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Inherit")] Inherit,
#endif
Count,
Count,
}
public enum LogLevel
@@ -362,6 +476,11 @@ namespace Config.Entities
[Description("zentriert")] Center,
[Description("rechts")] Right,
[Description("angepasst")] Justified,
#elif LANG_FR
[Description("gauche")] Left,
[Description("centré")] Center,
[Description("droit")] Right,
[Description("justifié")] Justified,
#else
[Description("Left")] Left,
[Description("Center")] Center,
@@ -370,4 +489,203 @@ namespace Config.Entities
#endif
Count
}
public enum VertAlignment
{
[Description("Top")] Top,
[Description("Middle")] Middle,
[Description("Bottom")] Bottom,
}
public enum TableForm
{
None,
Rows,
Columns,
ColumnsPL,
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_FR
[Description("éteindre")] Off,
[Description("info")] Info,
[Description("allumé")] 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
}
public enum ErrorFlagShift
{
E1 = 0,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
E11,
E12,
E13,
E14,
E15,
E16,
E17,
E18,
E19,
E20,
E21,
E22,
E23,
E24,
E25,
E26,
E27,
E28,
E29,
E30,
E31,
E32,
E33,
E34,
E35,
E36,
E37,
E38,
E39,
E40,
E41,
E42,
E43,
E44,
E45,
E46,
E47,
E48,
E49,
E50,
E51,
E52,
E53,
E54,
E55,
E56,
E57,
E58,
E59,
E60,
E61,
E62,
E63,
}
public enum ErrorFlagMask : long
{
E1 = (1 << (int)ErrorFlagShift.E1),
E2 = (1 << (int)ErrorFlagShift.E2),
E3 = (1 << (int)ErrorFlagShift.E3),
E4 = (1 << (int)ErrorFlagShift.E4),
E5 = (1 << (int)ErrorFlagShift.E5),
E6 = (1 << (int)ErrorFlagShift.E6),
E7 = (1 << (int)ErrorFlagShift.E7),
E8 = (1 << (int)ErrorFlagShift.E8),
E9 = (1 << (int)ErrorFlagShift.E9),
E10 = (1 << (int)ErrorFlagShift.E10),
E11 = (1 << (int)ErrorFlagShift.E11),
E12 = (1 << (int)ErrorFlagShift.E12),
E13 = (1 << (int)ErrorFlagShift.E13),
E14 = (1 << (int)ErrorFlagShift.E14),
E15 = (1 << (int)ErrorFlagShift.E15),
E16 = (1 << (int)ErrorFlagShift.E16),
E17 = (1 << (int)ErrorFlagShift.E17),
E18 = (1 << (int)ErrorFlagShift.E18),
E19 = (1 << (int)ErrorFlagShift.E19),
E20 = (1 << (int)ErrorFlagShift.E20),
E21 = (1 << (int)ErrorFlagShift.E21),
E22 = (1 << (int)ErrorFlagShift.E22),
E23 = (1 << (int)ErrorFlagShift.E23),
E24 = (1 << (int)ErrorFlagShift.E24),
E25 = (1 << (int)ErrorFlagShift.E25),
E26 = (1 << (int)ErrorFlagShift.E26),
E27 = (1 << (int)ErrorFlagShift.E27),
E28 = (1 << (int)ErrorFlagShift.E28),
E29 = (1 << (int)ErrorFlagShift.E29),
E30 = (1 << (int)ErrorFlagShift.E30),
E31 = (1 << (int)ErrorFlagShift.E31),
E32 = (1 << (int)ErrorFlagShift.E32),
E33 = (1 << (int)ErrorFlagShift.E33),
E34 = (1 << (int)ErrorFlagShift.E34),
E35 = (1 << (int)ErrorFlagShift.E35),
E36 = (1 << (int)ErrorFlagShift.E36),
E37 = (1 << (int)ErrorFlagShift.E37),
E38 = (1 << (int)ErrorFlagShift.E38),
E39 = (1 << (int)ErrorFlagShift.E39),
E40 = (1 << (int)ErrorFlagShift.E40),
E41 = (1 << (int)ErrorFlagShift.E41),
E42 = (1 << (int)ErrorFlagShift.E42),
E43 = (1 << (int)ErrorFlagShift.E43),
E44 = (1 << (int)ErrorFlagShift.E44),
E45 = (1 << (int)ErrorFlagShift.E45),
E46 = (1 << (int)ErrorFlagShift.E46),
E47 = (1 << (int)ErrorFlagShift.E47),
E48 = (1 << (int)ErrorFlagShift.E48),
E49 = (1 << (int)ErrorFlagShift.E49),
E50 = (1 << (int)ErrorFlagShift.E50),
E51 = (1 << (int)ErrorFlagShift.E51),
E52 = (1 << (int)ErrorFlagShift.E52),
E53 = (1 << (int)ErrorFlagShift.E53),
E54 = (1 << (int)ErrorFlagShift.E54),
E55 = (1 << (int)ErrorFlagShift.E55),
E56 = (1 << (int)ErrorFlagShift.E56),
E57 = (1 << (int)ErrorFlagShift.E57),
E58 = (1 << (int)ErrorFlagShift.E58),
E59 = (1 << (int)ErrorFlagShift.E59),
E60 = (1 << (int)ErrorFlagShift.E60),
E61 = (1 << (int)ErrorFlagShift.E61),
E62 = (1 << (int)ErrorFlagShift.E62),
E63 = (1 << (int)ErrorFlagShift.E63),
}
}
+4 -6
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
@@ -8,17 +8,15 @@ namespace Config.Entities
public class Group
{
public virtual int Id { get; protected set; }
public virtual int Gid { get; set; }
public virtual string Name { get; set; }
public virtual Users.Entities.GID GID { get; set; }
public Group()
{
}
public Group(int gid, string name)
public Group(Users.Entities.GID gid)
{
Gid = gid;
Name = name;
GID = gid;
}
}
}
@@ -1,10 +1,19 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.Generic
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace Config.Entities
{
public interface IParamsProvider
{
/// <summary>
/// Get XML Serializer
/// </summary>
XmlSerializer GetSerializer();
string ComponentName { get; }
/// <summary>
@@ -13,13 +22,19 @@ namespace TBF.BenchControl.Generic
int ParamsCount();
/// <summary>
/// Parameter names
/// Returns a parameter name
/// </summary>
/// <param name="ix">Zero based index of the parameter</param>
string ParamName(int ix);
/// <summary>
/// Returns a list of possible values of one parameter (ComboBox when editing) or null (Textbox when editing).
/// </summary>
/// <param name="ix">Zero based index of the parameter</param>
IList<string> ParamValues(int ix);
/// <summary>
/// Parameter values in string form
/// Returns a parameter value in the string form
/// </summary>
/// <param name="ix">Zero based index of the parameter</param>
string ToString(int ix);
@@ -43,9 +58,13 @@ namespace TBF.BenchControl.Generic
/// </summary>
/// <param name="ix">Zero based index of the parameter</param>
/// <param name="strValue">String representation of the parameter</param>
void UpdateParam(int ix, string strValue);
CfgUpdateFlags UpdateParam(int ix, string strValue);
void UpdateDbEntity();
/// <summary>
/// Updates DB entities for related parameters
/// </summary>
/// <returns>true when successful</returns>
bool UpdateEmbeddedDbEntity();
/// <summary>
/// Creates an object copy
+44
View File
@@ -0,0 +1,44 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
namespace Config.Entities
{
public enum Side
{
#if LANG_CS
[Description("Levá")] Left,
[Description("Pravá")] Right,
#else
[Description("Left")] Left,
[Description("Right")] Right,
#endif
Count
}
public enum FlowDir
{
R_L,
L_R,
Count
}
public enum Counting
{
Arbitrary,
Positive,
Negative,
Count
}
public enum OptoHeadState
{
Disabled,
OptoAndDirOK,
OptoNok,
DirNok,
Count
}
}
+12 -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,18 @@ 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()
{
RangeIx = 0;
}
public MeasurementCorrection(int rangeIx)
{
RangeIx = rangeIx;
}
}
}
+325
View File
@@ -0,0 +1,325 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
/// <summary>
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
/// </summary>
public class PTest : 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 double CoefQfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual double CoefQto { get; set; } /// Water flow high limit in [m3/h]
public virtual double ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual double TempLimHi { get; set; } /// Upper limit for the controlled temperature
public virtual double PressLimLo { get; set; } /// [bar] min. water pressure
public virtual double PressLimHi { get; set; } /// [bar] max. water pressure
public virtual sbyte E1 { get; set; } ///
public virtual sbyte E2 { get; set; } ///
public virtual sbyte E3 { get; set; } ///
public virtual sbyte E4 { get; set; } ///
public virtual sbyte E5 { get; set; } ///
public virtual sbyte E6 { get; set; } ///
public virtual sbyte E7 { get; set; } ///
public virtual sbyte E8 { get; set; } ///
public virtual sbyte E9 { get; set; } /// 0=off, 1=info, 2=evaluate
public virtual sbyte E10 { get; set; } ///
public virtual sbyte E11 { get; set; } ///
public virtual sbyte E12 { get; set; } ///
public virtual sbyte E13 { get; set; } ///
public virtual sbyte E14 { get; set; } ///
public virtual sbyte E15 { get; set; } ///
public virtual sbyte E16 { get; set; } ///
public virtual sbyte E21 { get; set; } ///
public virtual double Delta_Q_pct { get; set; } /// [%] max deviation from the mean flow
public virtual double Delta_T { get; set; } /// [°C] max. T_up or T_down deviation from the mean temperature
public virtual double Delta_Tup_Tdn { get; set; } /// [°C] max. difference abs(T_up - T_down)
public virtual double TestTime_min { get; set; } /// [s]
public virtual double TestTime_max { get; set; } /// [s]
public virtual double AmbTemp_min { get; set; } /// [°C] min. ambient temperature
public virtual double AmbTemp_max { get; set; } /// [°C] max. ambient temperature
public virtual double Coef_E9 { get; set; } /// Coefficient used in E9, default 0.025
public virtual double Coef_E10 { get; set; } /// Coefficient used in E10, default 0.04
public virtual double Coef_E11 { get; set; } /// Coefficient used in E11, default 0.1
public virtual double Coef_E12 { get; set; } /// Coefficient used in E12, default 1
public virtual double Offset_E9 { get; set; } /// [s] default 0 (no offset)
public virtual double Offset_E12 { get; set; } /// [s] default 0 (no offset)
public virtual Profile Profile { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public PTest()
{
///
/// Default values
///
Part = 0;
CoefQfrom = 1.0;
CoefQto = 1.1;
ErrLimLo = -2.0; /// [%]
ErrLimHi = 2.0; /// [%]
TempLimLo = 15.0; /// [°C]
TempLimHi = 25.0; /// [°C]
PressLimLo = 0; /// [bar]
PressLimHi = 16.0; /// [bar]
E1 = 1;
E2 = 1;
E3 = 1;
E4 = 1;
E5 = 1;
E6 = 1;
E7 = 1;
E8 = 1;
E9 = 1;
E10 = 1;
E11 = 1;
E12 = 1;
E13 = 1;
E14 = 1;
E15 = 1;
E16 = 1;
E21 = 1;
Delta_Q_pct = 5.0; /// [%]
Delta_T = 10.0; /// [°C]
Delta_Tup_Tdn = 10.0; /// [°C]
TestTime_min = 0; /// [s]
TestTime_max = 99999; /// [s]
AmbTemp_min = 5.0; /// [°C]
AmbTemp_max = 95.0; /// [°C]
Coef_E9 = 0.025;
Coef_E10 = 0.04;
Coef_E11 = 0.1;
Coef_E12 = 1.0;
Offset_E9 = 0; /// [s]
Offset_E12 = 0; /// [s]
}
public PTest(string name, int itemNr, Profile profile)
: this()
{
Name = name;
ItemNr = itemNr;
Profile = profile;
}
// Makes a new copy of this object (not just a reference)
public virtual PTest Clone()
{
PTest result = new PTest(Name, ItemNr, Profile);
result.Part = Part;
result.CoefQfrom = CoefQfrom;
result.CoefQto = CoefQto;
result.ErrLimLo = ErrLimLo;
result.ErrLimHi = ErrLimHi;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PressLimLo = PressLimLo;
result.PressLimHi = PressLimHi;
result.E1 = E1;
result.E2 = E2;
result.E3 = E3;
result.E4 = E4;
result.E5 = E5;
result.E6 = E6;
result.E7 = E7;
result.E8 = E8;
result.E9 = E9;
result.E10 = E10;
result.E11 = E11;
result.E12 = E12;
result.E13 = E13;
result.E14 = E14;
result.E15 = E15;
result.E16 = E16;
result.E21 = E21;
result.Delta_Q_pct = Delta_Q_pct;
result.Delta_T = Delta_T;
result.Delta_Tup_Tdn = Delta_Tup_Tdn;
result.TestTime_min = TestTime_min;
result.TestTime_max = TestTime_max;
result.AmbTemp_min = AmbTemp_min;
result.AmbTemp_max = AmbTemp_max;
result.Coef_E9 = Coef_E9;
result.Coef_E10 = Coef_E10;
result.Coef_E11 = Coef_E11;
result.Coef_E12 = Coef_E12;
result.Offset_E9 = Offset_E9;
result.Offset_E12 = Offset_E12;
return result;
}
public virtual void Export(StreamWriter output)
{
CultureInfo ci = CultureInfo.InvariantCulture;
output.WriteLine(Name);
output.WriteLine(Part);
output.WriteLine(CoefQfrom.ToString(ci));
output.WriteLine(CoefQto.ToString(ci));
output.WriteLine(ErrLimLo.ToString(ci));
output.WriteLine(ErrLimHi.ToString(ci));
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PressLimLo.ToString(ci));
output.WriteLine(PressLimHi.ToString(ci));
output.WriteLine(E1.ToString());
output.WriteLine(E2.ToString());
output.WriteLine(E3.ToString());
output.WriteLine(E4.ToString());
output.WriteLine(E5.ToString());
output.WriteLine(E6.ToString());
output.WriteLine(E7.ToString());
output.WriteLine(E8.ToString());
output.WriteLine(E9.ToString());
output.WriteLine(E10.ToString());
output.WriteLine(E11.ToString());
output.WriteLine(E12.ToString());
output.WriteLine(E13.ToString());
output.WriteLine(E14.ToString());
output.WriteLine(E15.ToString());
output.WriteLine(E16.ToString());
output.WriteLine(E21.ToString());
output.WriteLine(Delta_Q_pct.ToString(ci));
output.WriteLine(Delta_T.ToString(ci));
output.WriteLine(Delta_Tup_Tdn.ToString(ci));
output.WriteLine(TestTime_min.ToString(ci));
output.WriteLine(TestTime_max.ToString(ci));
output.WriteLine(AmbTemp_min.ToString(ci));
output.WriteLine(AmbTemp_max.ToString(ci));
output.WriteLine(Coef_E9.ToString(ci));
output.WriteLine(Coef_E10.ToString(ci));
output.WriteLine(Coef_E11.ToString(ci));
output.WriteLine(Coef_E12.ToString(ci));
output.WriteLine(Offset_E9.ToString(ci));
output.WriteLine(Offset_E12.ToString(ci));
}
public static PTest Import(StreamReader input, Profile newProfile)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine))
{
return null;
}
CultureInfo ci = CultureInfo.InvariantCulture;
PTest tst = new PTest();
tst.Name = firstLine;
tst.Part = int.Parse(input.ReadLine());
tst.CoefQfrom = double.Parse(input.ReadLine(), ci);
tst.CoefQto = double.Parse(input.ReadLine(), ci);
tst.ErrLimLo = double.Parse(input.ReadLine(), ci);
tst.ErrLimHi = double.Parse(input.ReadLine(), ci);
tst.TempLimLo = double.Parse(input.ReadLine(), ci);
tst.TempLimHi = double.Parse(input.ReadLine(), ci);
/// TODO (E1 .. E21)
tst.Delta_Q_pct = double.Parse(input.ReadLine(), ci);
tst.Delta_T = double.Parse(input.ReadLine(), ci);
tst.Delta_Tup_Tdn = double.Parse(input.ReadLine(), ci);
tst.TestTime_min = double.Parse(input.ReadLine(), ci);
tst.TestTime_max = double.Parse(input.ReadLine(), ci);
tst.AmbTemp_min = double.Parse(input.ReadLine(), ci);
tst.AmbTemp_max = double.Parse(input.ReadLine(), ci);
tst.Coef_E9 = double.Parse(input.ReadLine(), ci);
tst.Coef_E10 = double.Parse(input.ReadLine(), ci);
tst.Coef_E11 = double.Parse(input.ReadLine(), ci);
tst.Coef_E12 = double.Parse(input.ReadLine(), ci);
tst.Offset_E9 = double.Parse(input.ReadLine(), ci);
tst.Offset_E12 = double.Parse(input.ReadLine(), ci);
tst.Profile = newProfile;
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()) { diff.AppendFormat(fmt, "Part", Part.ToString(), ln); };
ln = inp.ReadLine(); if (ln != CoefQfrom.ToString(ci)) { diff.AppendFormat(fmt, "CoefQfrom", CoefQfrom.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != CoefQto.ToString(ci)) { diff.AppendFormat(fmt, "CoefQto", CoefQto.ToString(ci), 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 != 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 != PressLimLo.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_min", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != PressLimHi.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_max", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != E1.ToString()) { diff.AppendFormat(fmt, "E1", E1.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E2.ToString()) { diff.AppendFormat(fmt, "E2", E2.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E3.ToString()) { diff.AppendFormat(fmt, "E3", E3.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E4.ToString()) { diff.AppendFormat(fmt, "E4", E4.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E5.ToString()) { diff.AppendFormat(fmt, "E5", E5.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E6.ToString()) { diff.AppendFormat(fmt, "E6", E6.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E7.ToString()) { diff.AppendFormat(fmt, "E7", E7.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E8.ToString()) { diff.AppendFormat(fmt, "E8", E8.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E9.ToString()) { diff.AppendFormat(fmt, "E9", E9.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E10.ToString()) { diff.AppendFormat(fmt, "E10", E10.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E11.ToString()) { diff.AppendFormat(fmt, "E11", E11.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E12.ToString()) { diff.AppendFormat(fmt, "E12", E12.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E13.ToString()) { diff.AppendFormat(fmt, "E13", E13.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E14.ToString()) { diff.AppendFormat(fmt, "E14", E14.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E15.ToString()) { diff.AppendFormat(fmt, "E15", E15.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E16.ToString()) { diff.AppendFormat(fmt, "E16", E16.ToString(), ln); };
ln = inp.ReadLine(); if (ln != E21.ToString()) { diff.AppendFormat(fmt, "E21", E21.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Delta_Q_pct.ToString(ci)) { diff.AppendFormat(fmt, "Delta_Q_pct", Delta_Q_pct.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Delta_T.ToString(ci)) { diff.AppendFormat(fmt, "Delta_T", Delta_T.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Delta_Tup_Tdn.ToString(ci)) { diff.AppendFormat(fmt, "Delta_Tup_Tdn", Delta_Tup_Tdn.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TestTime_min.ToString(ci)) { diff.AppendFormat(fmt, "TestTime_min", TestTime_min.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TestTime_max.ToString(ci)) { diff.AppendFormat(fmt, "TestTime_max", TestTime_max.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != AmbTemp_min.ToString(ci)) { diff.AppendFormat(fmt, "AmbTemp_min", AmbTemp_min.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != AmbTemp_max.ToString(ci)) { diff.AppendFormat(fmt, "AmbTemp_max", AmbTemp_max.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E9.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E9", Coef_E9.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E10.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E10", Coef_E10.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E11.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E11", Coef_E11.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Coef_E12.ToString(ci)) { diff.AppendFormat(fmt, "Coef_E12", Coef_E12.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Offset_E9.ToString(ci)) { diff.AppendFormat(fmt, "Offset_E9", Offset_E9.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Offset_E12.ToString(ci)) { diff.AppendFormat(fmt, "Offset_E12", Offset_E12.ToString(ci), ln); };
return diff.ToString();
}
public override string ToString()
{
return string.Format("{0}", Name);
}
}
}
+54 -9
View File
@@ -28,10 +28,9 @@ namespace Config.Entities
public virtual int Revision { get; set; }
public virtual int PredecessorId { get; set; }
public virtual bool ObtainedByCopy { get; set; } /// Initial version of this procedure was a copy of another procedure
///
///
public virtual 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
@@ -42,6 +41,9 @@ 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; }
@@ -60,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)
@@ -82,15 +86,12 @@ namespace Config.Entities
result.LastChgUser = LastChgUser;
result.LastChgTime = LastChgTime;
result.LongDescription = LongDescription;
result.ProcedureState = ProcedureState;
result.Revision = Revision;
result.PredecessorId = Id;
result.ObtainedByCopy = ObtainedByCopy;
result.MetersKind = MetersKind;
result.Watermeters = Watermeters;
result.ProtocolTitle = ProtocolTitle;
result.Protected = Protected;
result.MustBeComplete = MustBeComplete;
result.ManualCtrlDisabled = ManualCtrlDisabled;
@@ -99,6 +100,8 @@ namespace Config.Entities
result.ResultsWriter = ResultsWriter;
result.TransitionStart = TransitionStart;
result.TransitionEnd = TransitionEnd;
result.AltProcName = AltProcName;
result.AltProcPeriod = AltProcPeriod;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone(result)); }
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
@@ -117,7 +120,6 @@ namespace Config.Entities
output.WriteLine(LastChgTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(MetersKind.ToString());
output.WriteLine(Watermeters);
output.WriteLine(ProtocolTitle);
output.WriteLine(Protected.ToString());
output.WriteLine(MustBeComplete.ToString());
output.WriteLine(ManualCtrlDisabled.ToString());
@@ -150,7 +152,6 @@ namespace Config.Entities
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.ProtocolTitle = input.ReadLine();
result.Protected = bool.Parse(input.ReadLine());
result.MustBeComplete = bool.Parse(input.ReadLine());
result.ManualCtrlDisabled = bool.Parse(input.ReadLine());
@@ -196,7 +197,6 @@ namespace Config.Entities
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 != ProtocolTitle) { diff.AppendFormat(fmt, "ProtocolTitle", ProtocolTitle, 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); };
@@ -225,6 +225,51 @@ namespace Config.Entities
return diff.ToString();
}
public virtual ComponentProcedure GetProcedureParamsEntity(string cmpntName)
{
foreach (var procPrms in MoreParams)
{
if (procPrms.CmpntName == cmpntName) return procPrms;
}
return null;
}
/// <summary>
/// Processes the selection done by the bench control panel in the main sequence.
/// </summary>
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
/// <returns>The selected test or null</returns>
public virtual Test GetTest(string expandedTestName, out int testIx, out int repetNr)
{
for (int ix = 0; ix < Tests.Count; ix++)
{
Test test = Tests[ix];
if (test.Name.Equals(expandedTestName))
{
/// Name is not expanded => Repeats==1
testIx = ix;
repetNr = 1;
return test;
}
for (int r = 1; r <= test.Repeats; r++)
{
if (test.GetExpandedTestName(r).Equals(expandedTestName))
{
testIx = ix;
repetNr = r;
return test;
}
}
}
testIx = 0;
repetNr = 1;
return null;
}
public override string ToString()
{
return string.Format("{0}, rev.{1}", Name, Revision);
+143
View File
@@ -0,0 +1,143 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
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 Profile : 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 CreationUser { get; set; } /// Name of the user who has created or changed this procedure
public virtual DateTime CreationTime { get; set; } /// Date and time of the creation or change
public virtual string LastChgUser { get; set; } /// Name of the user who has created or changed this procedure
public virtual DateTime LastChgTime { get; set; } /// Date and time of the creation or change
public virtual ProfileType ProfileType { get; set; }
public virtual ErrorLimitType ErrorLimitType { get; set; }
public virtual IList<PTest> Tests { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Profile()
{
Tests = new List<PTest>();
///
/// Default values
///
CreationUser = (Users.GlobalData.CurrentUser != null) ? Users.GlobalData.CurrentUser.UserName : null;
CreationTime = DateTime.Now;
LastChgUser = CreationUser;
LastChgTime = CreationTime;
Description = string.Empty;
}
public Profile(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public virtual Profile Clone()
{
Profile result = new Profile();
result.ItemNr = ItemNr;
result.Name = Name;
result.Description = Description;
result.CreationUser = CreationUser;
result.CreationTime = CreationTime;
result.LastChgUser = LastChgUser;
result.LastChgTime = LastChgTime;
result.ProfileType = ProfileType;
result.ErrorLimitType = ErrorLimitType;
foreach (var test in Tests) { result.Tests.Add(test.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));
foreach (var test in Tests) { test.Export(output); }
output.WriteLine();
output.Close();
}
public static Profile Import(StreamReader input)
{
Profile result = new Profile();
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();
while (true)
{
PTest tst = PTest.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
//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}", Name);
}
}
}
+157 -26
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -18,19 +18,21 @@ namespace Config.Entities
public virtual string Name { get; set; }
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool DoEvaluate { get; set; }
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual TestProfile Profile { get; set; } /// UserDefined, Protected, UserDefinedHeatMeter, ProtectedHeatMeter
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 Qtg { get; set; } /// Target water flow [m3/h]
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 ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual float ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual float Uncertainty { get; set; } /// int [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual int Repeats { get; set; }
public virtual bool DoDraining { get; set; }
public virtual bool DoZeroing { get; set; }
public virtual bool DoDrainingAfter { 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
@@ -43,7 +45,7 @@ namespace Config.Entities
public virtual int TimePump2StartV { get; set; } /// Delay time from the start of the pump to opening the start valve in [s]
public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
public virtual double TolerRed { get; set; } /// = Filter
public virtual TestRedType RedType { get; set; }
public virtual string RedType { get; set; }
public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
@@ -53,9 +55,11 @@ namespace Config.Entities
#endif
public virtual string RelTransBefore { get; set; }
public virtual string RelTransBetween { get; set; }
public virtual string RelTransAfter { get; set; }
public virtual string TransitionAfter { get; set; }
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database
public virtual IList<ComponentTest> MoreParams { get; set; }
public virtual Procedure Procedure { get; set; }
@@ -69,11 +73,13 @@ namespace Config.Entities
///
/// Default values
///
Publish = (sbyte)Config.Entities.Publish.Always;
Part = 0;
Profile = TestProfile.UserDefined;
Publish = (sbyte)Config.Entities.Publish.Always;
DoEvaluate = true;
Repeats = 1;
DoDraining = false;
DoZeroing = false;
DoDrainingAfter = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
@@ -91,7 +97,6 @@ namespace Config.Entities
TolerRed = 0; /// = Filter parameter
RelTransBefore = string.Empty;
RelTransBetween = string.Empty;
RelTransAfter = string.Empty;
TransitionAfter = string.Empty;
}
@@ -109,15 +114,21 @@ namespace Config.Entities
Test result = new Test(Name, ItemNr, Procedure);
result.Part = Part;
result.Publish = Publish;
result.Profile = Profile;
result.Publish = Publish;
result.DoEvaluate = DoEvaluate;
result.Qtg = Qtg;
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.DoDraining = DoDraining;
result.DoZeroing = DoZeroing;
result.DoDrainingAfter = DoDrainingAfter;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
@@ -129,10 +140,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;
@@ -144,7 +151,6 @@ namespace Config.Entities
#endif
result.RelTransBefore = RelTransBefore;
result.RelTransBetween = RelTransBetween;
result.RelTransAfter = RelTransAfter;
result.TransitionAfter = TransitionAfter;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
@@ -159,6 +165,7 @@ namespace Config.Entities
output.WriteLine(Part.ToString(ci));
output.WriteLine(Publish.ToString(ci));
output.WriteLine(DoEvaluate.ToString());
output.WriteLine(Qtg.ToString(ci));
output.WriteLine(Qfrom.ToString(ci));
output.WriteLine(Qto.ToString(ci));
output.WriteLine(Volume.ToString(ci));
@@ -169,7 +176,7 @@ namespace Config.Entities
output.WriteLine(Uncertainty.ToString(ci));
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoZeroing.ToString());
output.WriteLine(DoDrainingAfter.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
@@ -187,7 +194,7 @@ namespace Config.Entities
output.WriteLine(MetersPath);
output.WriteLine(RelTransBefore);
output.WriteLine(RelTransBetween);
output.WriteLine(RelTransAfter);
output.WriteLine(Profile);
output.WriteLine(TransitionAfter);
foreach (var prms in MoreParams) { prms.Export(output); }
@@ -209,7 +216,8 @@ namespace Config.Entities
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.Qtg = float.Parse(input.ReadLine(), ci);
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);
@@ -219,7 +227,7 @@ namespace Config.Entities
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.DoDrainingAfter = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
@@ -237,7 +245,10 @@ namespace Config.Entities
tst.MetersPath = input.ReadLine();
tst.RelTransBefore = input.ReadLine();
tst.RelTransBetween = input.ReadLine();
tst.RelTransAfter = input.ReadLine();
string line = input.ReadLine();
tst.Profile = line.Equals(TestProfile.ProtectedHeatMeter.ToString()) ? TestProfile.ProtectedHeatMeter
: line.Equals(TestProfile.UserDefinedHeatMeter.ToString()) ? TestProfile.UserDefinedHeatMeter
: line.Equals(TestProfile.Protected.ToString()) ? TestProfile.Protected : TestProfile.UserDefined; /// UserDefined is the default
tst.TransitionAfter = input.ReadLine();
while (true)
@@ -267,6 +278,7 @@ namespace Config.Entities
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 != Qtg.ToString(ci)) { diff.AppendFormat(fmt, "Qtg", Qtg.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); };
@@ -277,7 +289,7 @@ namespace Config.Entities
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 != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoDrainingAfter.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); };
@@ -295,12 +307,131 @@ namespace Config.Entities
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 != Profile.ToString()) { diff.AppendFormat(fmt, "RelTransAfter", Profile, ln); };
ln = inp.ReadLine(); if (ln != TransitionAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransitionAfter, ln); };
return diff.ToString();
}
public virtual ComponentTest GetTestParamsEntity(string cmpntName)
{
foreach (var tstPrms in MoreParams)
{
if (tstPrms.CmpntName == cmpntName) return tstPrms;
}
return null;
}
/// <summary>
/// Return test title for a this test and a given repetition number
/// </summary>
/// <param name="repetitonNr">1 .. Nr. repetitions</param>
/// <returns>Test title (string)</returns>
public virtual string GetExpandedTestName(int repetitionNr)
{
if (Repeats == 1)
{
if (Part == 0)
{
/// Single test
return Name;
}
else
{
/// A part of a single test
return string.Format("{0} ({1})", Name, Part);
}
}
else
{
/// More test repetitions
return string.Format("{0} ({1}/{2})", Name, repetitionNr, Repeats);
}
}
public virtual double GetErrLimLo(double volumeCTV, double testTime)
{
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);
double Qp = Math.Abs(ErrLimHi);
double Q = (testTime == 0) ? 1 : Math.Max(3.6 * volumeCTV / testTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.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 GetErrLimHi(double volumeCTV, double testTime)
{
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);
double Qp = Math.Abs(ErrLimHi);
double Q = (testTime == 0) ? 1 : Math.Max(3.6 * volumeCTV / testTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.5, 1.0 + 0.01 * Qp / Q);
case 2: return +Math.Min(5.0, 2.0 + 0.02 * Qp / Q);
case 3: return +Math.Min(5.0, 3.0 + 0.05 * Qp / Q);
}
}
}
public virtual bool IsPartCompatible(int waterMeterPartNr)
{
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
if ((this.Part % 10) == waterMeterPartNr) return true;
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
return false;
}
/// <summary>
/// Determines whether tests part number is OK.
/// Examples of correct part number are:
/// 1, 2, 12, 21 in case of max. part nr.== 2
/// 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234 in case of max. part nr.== 4
/// </summary>
/// <param name="partNr">Tests par tnumber</param>
/// <returns>true when Part number is OK</returns>
public static bool IsGoodPartNr(int partNr)
{
bool firstDigitIsOK = ((partNr % 10) > 0) && ((partNr % 10) <= Config.Data.MaxPartNr);
bool secondDigitIsOK = (((partNr/10) % 10) > 0) && (((partNr/10) % 10) <= Config.Data.MaxPartNr);
bool thirdDigitIsOK = (((partNr/100) % 10) > 0) && (((partNr/100) % 10) <= Config.Data.MaxPartNr);
bool fourthDigitIsOK = (((partNr/1000) % 10) > 0) && (((partNr/1000) % 10) <= Config.Data.MaxPartNr);
if (firstDigitIsOK && (partNr / 10 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && (partNr / 100 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && (partNr / 1000 == 0)) return true;
if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && fourthDigitIsOK && (partNr / 10000 == 0)) return true;
return false;
}
public override string ToString()
{
string partStr = (Part > 0) ? string.Format(", part {0}", Part) : string.Empty;
+56 -2
View File
@@ -1,7 +1,10 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
@@ -37,5 +40,56 @@ namespace Config.Entities
foreach (var step in TransitionSteps) { result.TransitionSteps.Add(step.Clone()); }
return result;
}
}
public virtual void Export(StreamWriter output)
{
output.WriteLine(ItemNr.ToString(CultureInfo.InvariantCulture));
output.WriteLine(Name);
output.WriteLine(Description);
foreach (var step in TransitionSteps) { step.Export(output); }
output.WriteLine();
output.Close();
}
public static TransitionSequence Import(StreamReader input)
{
TransitionSequence result = new TransitionSequence();
result.ItemNr = int.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.Name = input.ReadLine();
result.Description = input.ReadLine();
while (true)
{
TransitionStep step = TransitionStep.Import(input, result);
if (step == null)
break;
else
result.TransitionSteps.Add(step);
}
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
const string fmt = "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
ln = inp.ReadLine(); /// skip ItemNr
ln = inp.ReadLine(); if (ln != Name) { diff.AppendFormat(fmt, "Name", Name, ln); };
ln = inp.ReadLine(); if (ln != Description) { diff.AppendFormat(fmt, "Description", Description, ln); };
//foreach (var step in TransitionSteps)
//{
// string testDiff = step.Compare(inp);
// if (testDiff.Contains(
//}
return diff.ToString();
}
}
}
+62 -1
View File
@@ -1,8 +1,10 @@
///
/// Copyright (c) 2013-2015, 2017 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
namespace Config.Entities
{
@@ -61,5 +63,64 @@ namespace Config.Entities
result += indent + "PumpsWithFMPct = " + PumpWithFMPcts + Environment.NewLine;
return result;
}
public virtual void Export(StreamWriter output)
{
CultureInfo ci = CultureInfo.InvariantCulture;
output.WriteLine(ItemNr.ToString(ci));
output.WriteLine(Duration.ToString(ci));
output.WriteLine(Message);
output.WriteLine(EndCondition);
output.WriteLine(ValvesOpen);
output.WriteLine(ValvesClose);
output.WriteLine(RegulValvesPct);
output.WriteLine(PumpWithFMPcts);
}
public static TransitionStep Import(StreamReader input, TransitionSequence newSequence)
{
string firstLine = input.ReadLine();
if (string.IsNullOrEmpty(firstLine))
{
return null;
}
CultureInfo ci = CultureInfo.InvariantCulture;
int itemNr = int.Parse(firstLine, ci);
TransitionStep tst = new TransitionStep(itemNr, newSequence);
tst.Duration = int.Parse(input.ReadLine(), ci);
tst.Message = input.ReadLine();
tst.EndCondition = input.ReadLine();
tst.ValvesOpen = input.ReadLine();
tst.ValvesClose = input.ReadLine();
tst.RegulValvesPct = input.ReadLine();
tst.PumpWithFMPcts = input.ReadLine();
return tst;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
string fmt = string.Format("Step {0} : ", ItemNr) + "{0} = {1}\r\n (in the file {2})\r\n";
string ln;
CultureInfo ci = CultureInfo.InvariantCulture;
string firstLine = inp.ReadLine();
if (string.IsNullOrEmpty(firstLine)) return string.Format("TransitionStep {0} is missing in the compared file\r\n", ItemNr);
if (ItemNr.ToString() != firstLine) { diff.AppendFormat(fmt, "ItemNr", ItemNr, firstLine); };
ln = inp.ReadLine(); if (ln != Duration.ToString(ci)) { diff.AppendFormat(fmt, "Duration", Duration.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Message) { diff.AppendFormat(fmt, "Message", Message, ln); };
ln = inp.ReadLine(); if (ln != EndCondition) { diff.AppendFormat(fmt, "EndCondition", EndCondition, ln); };
ln = inp.ReadLine(); if (ln != ValvesOpen) { diff.AppendFormat(fmt, "ValvesOpen", ValvesOpen, ln); };
ln = inp.ReadLine(); if (ln != ValvesClose) { diff.AppendFormat(fmt, "ValvesClose", ValvesClose, ln); };
ln = inp.ReadLine(); if (ln != RegulValvesPct) { diff.AppendFormat(fmt, "RegulValvesPct", RegulValvesPct, ln); };
ln = inp.ReadLine(); if (ln != PumpWithFMPcts) { diff.AppendFormat(fmt, "PumpWithFMPcts", PumpWithFMPcts, ln); };
return diff.ToString();
}
}
}
+20
View File
@@ -0,0 +1,20 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
namespace Config.Entities
{
public class Uncertainty
{
public virtual int Id { get; protected set; }
public virtual float Measurement { get; set; }
public virtual float MainUncertainty { get; set; }
public virtual float Resolution { get; set; }
public virtual float DriftPerYr { get; set; }
public virtual float Conditions { get; set; }
public virtual float UncertaintyOfCorrection { get; set; }
public Uncertainty() { }
}
}
+6 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -11,8 +11,12 @@ namespace Config.Entities
public virtual int Id { get; protected set; }
public virtual string UserName { get; set; } /// = name, alias, abbreviation
public virtual string FullName { get; set; } /// = description
public virtual int Number { get; set; }
public virtual string Tag { get; set; }
public virtual int Number { get; set; }
public virtual string Password { get; set; }
public virtual string Password2 { get; set; }
public virtual string Password3 { get; set; }
public virtual string Password4 { get; set; }
public virtual DateTime LastPwChange { get; set; }
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
+21 -1
View File
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
namespace Config.Entities
{
@@ -35,5 +36,24 @@ namespace Config.Entities
foreach (var step in VirtualBenchSteps) { result.VirtualBenchSteps.Add(step.Clone()); }
return result;
}
public virtual void Export(StreamWriter output)
{
/// TODO
}
public static VirtualBenchSequence Import(StreamReader input)
{
VirtualBenchSequence result = new VirtualBenchSequence();
/// TODO
return result;
}
public virtual string Compare(StreamReader inp)
{
System.Text.StringBuilder diff = new System.Text.StringBuilder();
/// TODO
return diff.ToString();
}
}
}
+14 -69
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@@ -39,7 +39,11 @@ namespace Config
dbType = Data.CurrentBench.WaterMetersDBSettings.DbType;
connectionString = Data.CurrentBench.WaterMetersDBSettings.ConnectionString;
break;
}
case Users.Entities.DBKind.RemoteConfig:
dbType = Data.CurrentBench.UsersDBSettings.DbType;
connectionString = Data.CurrentBench.UsersDBSettings.ConnectionString;
break;
}
return CreateSessionFactory(database, dbType, connectionString, false);
}
@@ -69,6 +73,7 @@ namespace Config
{
default:
case Users.Entities.DBKind.Config:
case Users.Entities.DBKind.RemoteConfig:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
break;
case Users.Entities.DBKind.Results:
@@ -122,41 +127,6 @@ namespace Config
return SessionFactories[ix].OpenSession();
}
public static void SaveToDb(Users.Entities.DBKind database, object obj)
{
SaveToDb(CreateSession(database), obj);
}
public static void SaveToDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
try
{
session.SaveOrUpdate(obj);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
}
}
public static void DeleteFromDb(Users.Entities.DBKind database, object obj)
{
DeleteFromDb(CreateSession(database), obj);
}
public static void DeleteFromDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
session.Delete(obj);
transaction.Commit();
}
}
/// <summary>
/// Create an empty users database.
/// Database contains only the user 'admin' and the control board component 'CB'.
@@ -177,13 +147,13 @@ namespace Config
///
/// Prepare all groups
///
var testers = new Config.Entities.Group((int)Users.Grp.GID.Testers, Strings.Tester);
var testingSpecialists = new Config.Entities.Group((int)Users.Grp.GID.TestingSpecialists, Strings.Testing_Specialist);
var headOfLab = new Config.Entities.Group((int)Users.Grp.GID.HeadOfLab, Strings.Head_of_Lab);
var maintenanceSpecialists = new Config.Entities.Group((int)Users.Grp.GID.MaintenanceSpecialists, Strings.Maintenance_Specialist);
var metrologists = new Config.Entities.Group((int)Users.Grp.GID.Metrologists, Strings.Metrologist);
var calibrationSpecialists = new Config.Entities.Group((int)Users.Grp.GID.CalibrationSpecialists, Strings.Calibration_Specialist);
var administrators = new Config.Entities.Group((int)Users.Grp.GID.Administrators, Strings.Administrator);
var testers = new Config.Entities.Group(Users.Entities.GID.Testers);
var testingSpecialists = new Config.Entities.Group(Users.Entities.GID.TestingSpecialists);
var headOfLab = new Config.Entities.Group(Users.Entities.GID.HeadOfLab);
var maintenanceSpecialists = new Config.Entities.Group(Users.Entities.GID.MaintenanceSpecialists);
var metrologists = new Config.Entities.Group(Users.Entities.GID.Metrologists);
var calibrationSpecialists = new Config.Entities.Group(Users.Entities.GID.CalibrationSpecialists);
var administrators = new Config.Entities.Group(Users.Entities.GID.Administrators);
/// Create the user 'admin' add his groups
var admin = new Config.Entities.User
@@ -213,30 +183,5 @@ namespace Config
return true;
}
/// <summary>
/// Create an empty water meters database
/// </summary>
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
/// <param name="connectionString">Connection string</param>
/// <returns>true=success, false=error</returns>
public static bool CreateEmptyResultsDB(Users.Entities.DBType dbType, string connectionString)
{
ISessionFactory sessionFactory = CreateSessionFactory(Users.Entities.DBKind.Results, dbType, connectionString, true);
if (sessionFactory == null) return false;
/// Populate the database
//using (var session = sessionFactory.OpenSession())
//{
// using (var transaction = session.BeginTransaction())
// {
// /// Create one component
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
// session.SaveOrUpdate(cmpnt);
// transaction.Commit();
// }
//}
return true;
}
}
}
@@ -1,24 +1,33 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
namespace TBF.BenchControl
namespace Config
{
public static class Formulas
{
private static readonly ILog log = LogManager.GetLogger(typeof(Formulas));
///
/// Tables to calculate specific enthalpy
///
private static readonly int[] Ii;
private static readonly int[] Ji;
private static readonly double[] ni;
private static readonly double[] Di;
///
/// Wrappers
///
public static double RealDensity() { return Data.RealDensity; }
public static double AtTemperature() { return Data.AtTemperature; }
public static double Buoyancy() { return Data.Buoyancy; }
/// Private tables with coeficients to calculate specific enthalpy
static readonly int[] Ii;
static readonly int[] Ji;
static readonly double[] ni;
/// Private table with coeficients to calculate temperature of a platinum thermometer
static readonly double[] Di;
/// <summary>
/// Constructor
@@ -83,19 +92,50 @@ namespace TBF.BenchControl
0.191203,
0.049025,
};
}
/// <summary>
/// Calculate density of distilled water from temperature
/// </summary>
/// <param name="t">ITS-90 temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double DistilledWaterDensityFromTemp(double t)
{
if (t <= 40)
{
const double c0 = 999.839564;
const double c1 = 0.067998613;
const double c2 = -0.0091101468;
const double c3 = 0.00010058299;
const double c4 = -0.0000011275659;
const double c5 = 6.5985371e-09;
return ((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t + c0;
}
else
{
const double a0 = 9.9983952E2;
const double a1 = 1.6952577E1;
const double a2 = -7.9905127E-3;
const double a3 = -4.6241757E-5;
const double a4 = 1.0584601E-7;
const double a5 = -2.8103006E-10;
const double b = 1.6887236E-2;
return (((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t + a0) / (1.0 + b * t);
}
}
/// <summary>
/// Calculate density of distilled water from temperature
/// Calculate density of distilled water from temperature (obsolete)
/// </summary>
/// <param name="t">Temperature in [°C]</param>
/// <param name="t">IPTS-68 temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double DistilledWaterDensityFromTemp(double t)
public static double DistilledWaterDensityFromTempIPTS68(double t)
{
const double a0 = 999.842594;
const double a1 = 0.06793952;
const double a2 = -0.00909529;
const double a2 = -0.009095290;
const double a3 = 0.0001001685;
const double a4 = -0.000001120083;
const double a5 = 6.536332e-09;
@@ -124,10 +164,27 @@ namespace TBF.BenchControl
/// <returns>Density in [kg/m3]</returns>
public static double WaterDensityFromTemp(double t)
{
return DistilledWaterDensityFromTemp(t) +
DensityCorrection(Program.LocalSettings.RealDensity, Program.LocalSettings.AtTemperature);
return DistilledWaterDensityFromTemp(t) + DensityCorrection(RealDensity(), AtTemperature());
}
/// <summary>
/// Calculate corrected (real) water density from temperature
/// </summary>
/// <param name="t">Temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double WaterDensityFromTempPress(double temp, double pressure)
{
double x0 = 5.08821E-10;
double x1 = 1.2639418;
double x2 = 0.2660269;
double x3 = 0.3734838;
double x4 = 2.0205242;
double theta = temp / 100.0;
double B = x0 * (((x3 * theta + x2) * theta + x1) * theta + 1) / (1 + x4 * theta);
return WaterDensityFromTemp(temp) * (1 + B * Config.Units.ConvertTo(Config.Unit.Pa, pressure));
}
public static float AirDensityFromAmbientVales(float tempC, float pressureBar, float humiPct)
{
@@ -160,57 +217,87 @@ namespace TBF.BenchControl
{
if (measuredVolume <= float.Epsilon)
{
log.WarnFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, 99.0);
return 99.0;
log.WarnFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, -100.0);
return -100.0;
}
log.WarnFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, 99.0);
return 99.0;
}
double error = 100.0 * (measuredVolume - trueVolume) / trueVolume;
log.InfoFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, error);
return error;
}
/// <summary>
/// Calculates corrected value form a list of corrections by interpolation.
/// It is assumed that values in the list 'corrections' are sorted.
/// </summary>
/// <param name="rawMeasurement">Raw uncorrected value</param>
/// <param name="corrections">Sorted (value, correction) pairs</param>
/// <returns>Corrected value</returns>
public static double CorrectedValue(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
{
if (corrections == null || corrections.Count == 0) return rawValue;
if (rawValue < corrections[0].Measurement)
{
return rawValue + corrections[0].Correction;
}
/// <summary>
/// Calculates corrected value from a list of corrections by interpolation.
/// It is assumed that values in the list 'corrections' are sorted.
/// </summary>
/// <param name="rawMeasurement">Raw uncorrected value</param>
/// <param name="corrections">Sorted (value, correction) pairs</param>
/// <returns>Corrected value</returns>
public static double CorrectedValue(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
{
return rawValue + GetCorrection(rawValue, corrections);
}
int count = corrections.Count;
for (int i = 1; i < count; i++)
{
if (rawValue < corrections[i].Measurement)
{
double d1 = rawValue - corrections[i-1].Measurement;
double d2 = corrections[i].Measurement - rawValue;
/// <summary>
/// Get a correction from a list of corrections by interpolation.
/// It is assumed that values in the list 'corrections' are sorted.
/// </summary>
/// <param name="rawMeasurement">Raw uncorrected value</param>
/// <param name="corrections">Sorted (value, correction) pairs</param>
/// <returns>Corrected value</returns>
public static double GetCorrection(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
{
if ((corrections == null) || (corrections.Count == 0)) return 0; /// No correction
double corr;
if (d1 + d2 <= float.Epsilon)
{
corr = (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
}
else
{
corr = (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
}
return rawValue + corr;
}
}
if (rawValue < corrections[0].Measurement)
{
/// rawValue is below the lowest value in the correction table
return corrections[0].Correction;
}
return rawValue + corrections[count - 1].Correction;
}
int count = corrections.Count;
for (int i = 1; i < count; i++)
{
if (rawValue < corrections[i].Measurement)
{
double d1 = rawValue - corrections[i - 1].Measurement;
double d2 = corrections[i].Measurement - rawValue;
if (d1 + d2 <= float.Epsilon)
{
/// Neigboring values in the corection table are close to each other -> calculate the average
return (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
}
else
{
/// Interpolate the correction from neigboring values in the corection table
return (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
}
}
}
/// rawValue is above the highest value in the correction table
return corrections[count - 1].Correction;
}
/// <summary>
/// Converts a measurement error to a correction (used when preparing correction tables).
/// </summary>
/// <param name="measuredValue">Measured value (in arbitrary units)</param>
/// <param name="error">Measurement error in %</param>
/// <returns>Correction in the same units as the measured value</returns>
public static double CorrectionFromError(double measuredValue, double error)
{
double trueValue = measuredValue / (1 + error/100);
double correction = trueValue - measuredValue;
return correction;
}
/// <summary>
@@ -316,11 +403,5 @@ namespace TBF.BenchControl
return (-(R0 * A) + Math.Sqrt(R0 * R0 * A * A - 4 * R0 * B * (R0 - R))) / (2 * R0 * B);
}
public static double Buoyancy()
{
return 1.00103;
}
}
}
+5 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -23,6 +23,9 @@ namespace Config.Mappings
HasMany(x => x.Corrections)
.OrderBy("Measurement")
.Cascade.All();
}
HasMany(x => x.Uncertainties)
.OrderBy("Measurement")
.Cascade.All();
}
}
}
+2 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
@@ -10,8 +10,7 @@ namespace Config.Mappings
public GroupMap()
{
Id(x => x.Id);
Map(x => x.Gid);
Map(x => x.Name);
Map(x => x.GID).Column("Name"); ;
}
}
}
+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);
}
+58
View File
@@ -0,0 +1,58 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class PTestMap : ClassMap<PTest>
{
public PTestMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.CoefQfrom);
Map(x => x.CoefQto);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PressLimLo);
Map(x => x.PressLimHi);
Map(x => x.E1);
Map(x => x.E2);
Map(x => x.E3);
Map(x => x.E4);
Map(x => x.E5);
Map(x => x.E6);
Map(x => x.E7);
Map(x => x.E8);
Map(x => x.E9);
Map(x => x.E10);
Map(x => x.E11);
Map(x => x.E12);
Map(x => x.E13);
Map(x => x.E14);
Map(x => x.E15);
Map(x => x.E16);
Map(x => x.E21);
Map(x => x.Delta_Q_pct);
Map(x => x.Delta_T);
Map(x => x.Delta_Tup_Tdn);
Map(x => x.TestTime_min);
Map(x => x.TestTime_max);
Map(x => x.AmbTemp_min);
Map(x => x.AmbTemp_max);
Map(x => x.Coef_E9);
Map(x => x.Coef_E10);
Map(x => x.Coef_E11);
Map(x => x.Coef_E12);
Map(x => x.Offset_E9);
Map(x => x.Offset_E12);
References(x => x.Profile);
}
}
}
+4 -1
View File
@@ -28,7 +28,6 @@ namespace Config.Mappings
Map(x => x.MetersKind);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.Protected);
Map(x => x.MustBeComplete);
Map(x => x.ManualCtrlDisabled);
@@ -38,6 +37,10 @@ namespace Config.Mappings
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)
+28
View File
@@ -0,0 +1,28 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class ProfileMap : ClassMap<Profile>
{
public ProfileMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.CreationUser);
Map(x => x.CreationTime);
Map(x => x.LastChgUser);
Map(x => x.LastChgTime);
Map(x => x.ProfileType);
Map(x => x.ErrorLimitType);
HasMany(x => x.Tests)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
+16 -9
View File
@@ -14,17 +14,21 @@ namespace Config.Mappings
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Publish);
Map(x => x.Profile);
Map(x => x.Publish);
Map(x => x.DoEvaluate)
.Column("Evaluate");
Map(x => x.Qfrom);
#if TEST_PROFILES
Map(x => x.Qtg);
#endif
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.DoDraining)
.Column("Emptying");
Map(x => x.DoZeroing)
Map(x => x.DoDrainingAfter)
.Column("Zeroing");
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
@@ -45,7 +49,7 @@ namespace Config.Mappings
Map(x => x.Uncertainty);
Map(x => x.TolerRed)
.Column("TolerRed"); /// ???
Map(x => x.RedType); /// ???
Map(x => x.RedType);
Map(x => x.FeedingPath);
Map(x => x.BenchPath);
Map(x => x.OutputPath);
@@ -53,11 +57,14 @@ namespace Config.Mappings
#if HEAT_METERS
Map(x => x.HeatMetersPath);
#endif
Map(x => x.RelTransBefore);
Map(x => x.RelTransBetween);
Map(x => x.RelTransAfter);
Map(x => x.TransitionAfter);
HasMany(x => x.MoreParams)
Map(x => x.RelTransBefore)
.Column("RelTransBefore");
Map(x => x.RelTransBetween)
.Column("RelTransBetween");
Map(x => x.TransitionAfter)
.Column("TransitionAfter");
HasMany(x => x.MoreParams)
.Cascade.All();
References(x => x.Procedure);
}
+22
View File
@@ -0,0 +1,22 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
namespace Config.Mappings
{
class UncertaintyMap : ClassMap<Uncertainty>
{
public UncertaintyMap()
{
Id(x => x.Id);
Map(x => x.Measurement);
Map(x => x.MainUncertainty);
Map(x => x.Resolution);
Map(x => x.DriftPerYr);
Map(x => x.Conditions);
Map(x => x.UncertaintyOfCorrection);
}
}
}
+5 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
@@ -12,7 +12,11 @@ namespace Config.Mappings
Id(x => x.Id);
Map(x => x.UserName).Column("Name");
Map(x => x.Number);
Map(x => x.Tag);
Map(x => x.Password);
Map(x => x.Password2);
Map(x => x.Password3);
Map(x => x.Password4);
Map(x => x.FullName).Column("Description");
Map(x => x.LastPwChange);
HasMany(x => x.Groups)
+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.14.595.0")]
[assembly: AssemblyFileVersion("2.14.595.0")]
[assembly: AssemblyVersion("2.24.1382.0")]
[assembly: AssemblyFileVersion("2.24.1382.0")]
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Kalibriertechniker</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Laborleiter</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Wartungstechniker</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Messtechniker</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Prüfer</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Prüftechniker</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NiO</value>
</data>
@@ -117,25 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Activity" xml:space="preserve">
<value>Činnosť</value>
<data name="Failed" xml:space="preserve">
<value>Échoué</value>
</data>
<data name="CancelBtnText" xml:space="preserve">
<value>Zrušiť</value>
<data name="Passed" xml:space="preserve">
<value>Passé</value>
</data>
<data name="Compound" xml:space="preserve">
<value>Združený</value>
</data>
<data name="Compound_meters" xml:space="preserve">
<value>Združené vodomery</value>
<data name="Cannot_open_DB_Cause_0" xml:space="preserve">
<value>Impossible d'ouvrir la base de données Cause\\r\\n{0}</value>
</data>
<data name="Error" xml:space="preserve">
<value>Chyba</value>
</data>
<data name="Language" xml:space="preserve">
<value>Jazyk</value>
</data>
<data name="OkBtnText" xml:space="preserve">
<value>Áno</value>
<value>Erreur</value>
</data>
</root>
-21
View File
@@ -117,27 +117,6 @@
<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>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Specjalista ds. kalibracji</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Kierownik Laboratorium</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Konserwator</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Metrolog</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Pracownik przeprowadzający testy</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Specjalista ds. testów</value>
</data>
<data name="Failed" xml:space="preserve">
<value>Niepowodzenie</value>
</data>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Calibration Specialist</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Head of Lab</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Maintenance Specialist</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Metrologist</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Tester</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Testing Specialist</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
-21
View File
@@ -117,27 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>Администратор</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>Специалист по калибровке</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>Руководитель лаборатории</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>Специалист по техобслуживанию</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>Метролог</value>
</data>
<data name="Tester" xml:space="preserve">
<value>Контролер</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>Специалист по тестированию</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
+125 -124
View File
@@ -1,128 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
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.
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Administrator" xml:space="preserve">
<value>管理员</value>
</data>
<data name="Calibration_Specialist" xml:space="preserve">
<value>校准专员</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Head_of_Lab" xml:space="preserve">
<value>实验室负责人</value>
</data>
<data name="Maintenance_Specialist" xml:space="preserve">
<value>维护专员</value>
</data>
<data name="Metrologist" xml:space="preserve">
<value>计量者</value>
</data>
<data name="Passed" xml:space="preserve">
<value>好</value>
</data>
<data name="Tester" xml:space="preserve">
<value>测试仪</value>
</data>
<data name="Testing_Specialist" xml:space="preserve">
<value>测试专员</value>
</data>
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="Error" xml:space="preserve">
<value>错误 Error</value>
</data>
<data name="Failed" xml:space="preserve">
<value>NOK</value>
</data>
<data name="Passed" xml:space="preserve">
<value>好</value>
</data>
</root>
+91 -12
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
///
using System;
using System.Reflection;
@@ -11,7 +11,14 @@ namespace Config
{
[Description("---")] None,
[Description("imp.")] pulse,
#if LANG_PL
[Description("stopień")] degree,
#else
[Description("degree")] degree,
#endif
[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 +36,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
@@ -61,9 +68,28 @@ namespace Config
[Description("kWh")] kWh, /// 1 kWh = 3600000 J
[Description("MWh")] MWh, /// 1 MWh = 3600000000 J
#if LANG_PL
[Description("imp/l")] ppl, /// * 1 pulse/l
[Description("imp/dm3")] ppdm3, /// * 1 pulse/dm3
[Description("stopień/l")] degpl, /// * 1 degree/l
[Description("stopień/dm3")] degpdm3, /// * 1 degree/dm3
[Description("l/imp")] lpp, /// * 1 l/pulse
[Description("dm3/imp")] dm3pp, /// * 1 dm3/pulse
[Description("l/stopień")] lpdeg, /// * 1 l/degree
[Description("dm3/stopień")] dm3pdeg, /// * 1 dm3/degree
#else
[Description("pulse/l")] ppl, /// * 1 pulse/l
///
[Description("pulse/dm3")] ppdm3, /// * 1 pulse/dm3
[Description("degree/l")] degpl, /// * 1 degree/l
[Description("degree/dm3")] degpdm3, /// * 1 degree/dm3
[Description("l/pulse")] lpp, /// * 1 l/pulse
[Description("dm3/pulse")] dm3pp, /// * 1 dm3/pulse
[Description("l/degree")] lpdeg, /// * 1 l/degree
[Description("dm3/degree")] dm3pdeg, /// * 1 dm3/degree
#endif
///
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
[Description("kWh/pulse")] kWhpp, /// * 1 kWh/pulse
Count
}
@@ -83,6 +109,7 @@ namespace Config
[Description("Länge")] Length,
[Description("Dichte")] Density,
[Description("Energie")] Energy,
[Description("Impulse")] Pulses,
[Description("Impulse/l")] PulsePerLtr,
[Description("Impulse/kWh")] PulsePerKWh,
@@ -92,7 +119,7 @@ namespace Config
[Description("Boolean")] Boolean,
[Description("Datum und Uhrzeit")] DateTime,
#elif LANG_PL
[Description("Objętość")] Volume,
[Description("Objętość")] Volume,
[Description("Przepływ")] Flow,
[Description("Masa")] Mass,
[Description("Czas")] Time,
@@ -103,6 +130,7 @@ namespace Config
[Description("Długość")] Length,
[Description("Gęstość")] Density,
[Description("Energia")] Energy,
[Description("Impulsy")] Pulses,
[Description("Impulsy/litr")] PulsePerLtr,
[Description("Impulsy/kWh")] PulsePerKWh,
@@ -123,6 +151,7 @@ namespace Config
[Description("Délka")] Length,
[Description("Hustota")] Density,
[Description("Energie")] Energy,
[Description("Pulzy")] Pulses,
[Description("Pulzy/litr")] PulsePerLtr,
[Description("Pulzy/kWh")] PulsePerKWh,
@@ -131,8 +160,29 @@ namespace Config
[Description("Text")] String,
[Description("Boolean")] Boolean,
[Description("Datum a čas")] DateTime,
#else
#elif LANG_IT
[Description("Volume")] Volume,
[Description("Flusso")] Flow,
[Description("Massa")] Mass,
[Description("Tempo")] Time,
[Description("Temperatura")] Temperature,
[Description("Pressione")] Pressure,
[Description("Umidità")] Humidity,
[Description("Errore")] Error,
[Description("Lungezza")] Length,
[Description("Densità")] Density,
[Description("Energia")] Energy,
[Description("Impulso")] Pulses,
[Description("Impulso/litro")] PulsePerLtr,
[Description("Impulso/kWh")] PulsePerKWh,
/// Quantities without units and conversions
[Description("Numero")] Number,
[Description("Stringa")] String,
[Description("Boolean")] Boolean,
[Description("Data e ora")] DateTime,
#else
[Description("Volume")] Volume,
[Description("Flow")] Flow,
[Description("Mass")] Mass,
[Description("Time")] Time,
@@ -143,6 +193,7 @@ namespace Config
[Description("Length")] Length,
[Description("Density")] Density,
[Description("Energy")] Energy,
[Description("Pulses")] Pulses,
[Description("Pulses/liter")] PulsePerLtr,
[Description("Pulses/kWh")] PulsePerKWh,
@@ -152,7 +203,7 @@ namespace Config
[Description("Boolean")] Boolean,
[Description("Date and time")] DateTime,
#endif
Count,
Count,
}
public static class Units
@@ -177,7 +228,12 @@ namespace Config
{
switch (units)
{
case Unit.pulse:
case Unit.degree:
return Config.Quantity.Pulses;
case Unit.l:
case Unit.dm3:
case Unit.m3:
case Unit.gal_UK:
case Unit.gal_US:
@@ -239,9 +295,17 @@ namespace Config
return Config.Quantity.Energy;
case Unit.ppl:
case Unit.ppdm3:
case Unit.degpl:
case Unit.degpdm3:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg:
return Config.Quantity.PulsePerLtr;
case Unit.ppkWh:
case Unit.kWhpp:
return Config.Quantity.PulsePerKWh;
default:
@@ -260,6 +324,7 @@ namespace Config
public static bool IsLength(Unit units) { return IsQuantity(units, Config.Quantity.Length); }
public static bool IsDensity(Unit units) { return IsQuantity(units, Config.Quantity.Density); }
public static bool IsEnergy(Unit units) { return IsQuantity(units, Config.Quantity.Energy); }
public static bool IsPulses(Unit units) { return IsQuantity(units, Config.Quantity.Pulses); }
public static bool IsPulsePerLtr(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerLtr); }
public static bool IsPulsePerKWh(Unit units) { return IsQuantity(units, Config.Quantity.PulsePerKWh); }
@@ -269,6 +334,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 +356,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
@@ -326,7 +392,13 @@ namespace Config
case Unit.kWh: return v / 3600000.0; /// 1 kWh = 3600000 J
case Unit.MWh: return v / 3600000000.0;/// 1 MWh = 3600000000 J
default: return v;
case Unit.kWhpp:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return ((v <= float.Epsilon) ? 0 : 1 / v);
default: return v;
}
}
@@ -335,6 +407,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 +429,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
@@ -392,7 +465,13 @@ namespace Config
case Unit.kWh: return 3600000 * v; /// 1 kWh = 3600000 J
case Unit.MWh: return 3600000000 * v; /// 1 kWh = 3600000000 J
default: return v;
case Unit.kWhpp:
case Unit.lpp:
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return ((v == 0) ? 0 : 1 / v);
default: return v;
}
}
}
+256
View File
@@ -0,0 +1,256 @@
///
/// Copyright (c) 2017-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Config
{
public static class Utils
{
public static string SignificantDigitsToFmt(double value, int sigDigits)
{
if (sigDigits == 6)
{
if (value >= 99999.5 || value < -99999.5) return "F0";
else if (value >= 9999.95 || value < -9999.95) return "F1";
else if (value >= 999.995 || value < -999.995) return "F2";
else if (value >= 99.9995 || value < -99.9995) return "F3";
else if (value >= 9.99995 || value < -9.99995) return "F4";
else if (value >= 0.999995 || value < -0.999995) return "F5";
else if (value >= 0.0999995 || value < -0.0999995) return "F6";
else if (value >= 0.00999995 || value < -0.00999995) return "F7";
else if (value >= 0.000999995 || value < -0.000999995) return "F8";
else if (value >= 0.0000999995 || value < -0.0000999995) return "F9";
else return "F10";
}
else if (sigDigits == 5)
{
if (value >= 9999.5 || value < -9999.5) return "F0";
else if (value >= 999.95 || value < -999.95) return "F1";
else if (value >= 99.995 || value < -99.995) return "F2";
else if (value >= 9.9995 || value < -9.9995) return "F3";
else if (value >= 0.99995 || value < -0.99995) return "F4";
else if (value >= 0.099995 || value < -0.099995) return "F5";
else if (value >= 0.0099995 || value < -0.0099995) return "F6";
else if (value >= 0.00099995 || value < -0.00099995) return "F7";
else if (value >= 0.000099995 || value < -0.000099995) return "F8";
else return "F9";
}
else if (sigDigits == 4)
{
if (value >= 999.5 || value < -999.5) return "F0";
else if (value >= 99.95 || value < -99.95) return "F1";
else if (value >= 9.995 || value < -9.995) return "F2";
else if (value >= 0.9995 || value < -0.9995) return "F3";
else if (value >= 0.09995 || value < -0.09995) return "F4";
else if (value >= 0.009995 || value < -0.009995) return "F5";
else if (value >= 0.0009995 || value < -0.0009995) return "F6";
else if (value >= 0.00009995 || value < -0.00009995) return "F7";
else return "F8";
}
else if (sigDigits == 3)
{
if (value >= 99.5 || value < -99.5) return "F0";
else if (value >= 9.95 || value < -9.95) return "F1";
else if (value >= 0.995 || value < -0.995) return "F2";
else if (value >= 0.0995 || value < -0.0995) return "F3";
else if (value >= 0.00995 || value < -0.00995) return "F4";
else if (value >= 0.000995 || value < -0.000995) return "F5";
else if (value >= 0.0000995 || value < -0.0000995) return "F6";
else return "F7";
}
else if (sigDigits == 2)
{
if (value >= 9.5 || value < -9.5) return "F0";
else if (value >= 0.95 || value < -0.95) return "F1";
else if (value >= 0.095 || value < -0.095) return "F2";
else if (value >= 0.0095 || value < -0.0095) return "F3";
else if (value >= 0.00095 || value < -0.00095) return "F4";
else if (value >= 0.000095 || value < -0.000095) return "F5";
else return "F6";
}
else /// if (sigDigits == 1)
{
if (value >= 0.95 || value < -0.95) return "F0";
else if (value >= 0.095 || value < -0.095) return "F1";
else if (value >= 0.0095 || value < -0.0095) return "F2";
else if (value >= 0.00095 || value < -0.00095) return "F3";
else if (value >= 0.000095 || value < -0.000095) return "F4";
else return "F5";
}
}
/// <summary>
/// Extract and return a DB server from a MySQL connection string.
/// </summary>
public static string GetDBServer(string connectionString)
{
return GetFromConnectionString(connectionString, new string[] { "SERVER=" });
}
/// <summary>
/// Extract and return a DB name from a MySQL connection string.
/// </summary>
public static string GetDBName(string connectionString)
{
return GetFromConnectionString(connectionString, new string[] { "DATABASE=" });
}
/// <summary>
/// Extract and return a username from a MySQL connection string
/// </summary>
public static string GetDBUser(string connectionString)
{
return GetFromConnectionString(connectionString, new string[] { "USER=", "UID=" });
}
/// <summary>
/// Extract and return a password from a MySQL connection string
/// </summary>
public static string GetDBPassword(string connectionString)
{
return GetFromConnectionString(connectionString, new string[] { "PASSWORD=", "PWD=" });
}
/// <summary>
/// Extract and return an element of a MySQL connection string
/// (a host, a database, a user name or a password).
/// Return an empty string on any error.
/// </summary>
public static string GetFromConnectionString(string connectionString, string[] patterns)
{
foreach (var pattern in patterns)
{
int startIx = connectionString.IndexOf(pattern);
if (startIx >= 0)
{
/// pattern found, extract the subsequent element
startIx += pattern.Length;
int endIx = connectionString.IndexOf(';', startIx);
return (endIx > 0) ? connectionString.Substring(startIx, endIx - startIx) : string.Empty;
}
}
/// pattern NOT found
return string.Empty;
}
/// <summary>
/// Get either Q1 or Qmin flow for a given Qn and metrological class
/// </summary>
/// <param name="Qn">Nominal flow in m3/h</param>
/// <param name="metroClass">Metrological class ("A" ,"B", "C" or "R#")</param>
/// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q1 or Qmin flow in m3/h</returns>
public static double GetQ1Qmin(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0)
{
if (string.IsNullOrEmpty(metroClass)) return Qdflt;
int metroClassRatio;
if ((metroClass[0] == 'R') && int.TryParse(metroClass.Substring(1), out metroClassRatio) && (metroClassRatio > 0))
{
return Qn / (double)metroClassRatio;
}
else
{
if (medium == Entities.Medium.HotWater)
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.04 * Qn) : (0.08 * Qn);
case "B": return (Qn < 15) ? (0.02 * Qn) : (0.04 * Qn);
case "C": return (Qn < 15) ? (0.01 * Qn) : (0.02 * Qn);
case "D": return (Qn < 15) ? (0.01 * Qn) : Qdflt;
default: break;
}
}
else
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.04 * Qn) : (0.08 * Qn);
case "B": return (Qn < 15) ? (0.02 * Qn) : (0.03 * Qn);
case "C": return (Qn < 15) ? (0.01 * Qn) : (0.006 * Qn);
default: break;
}
}
}
return Qdflt;
}
/// <summary>
/// Get either Q2 or Qt flow for a given Qn and metrological class
/// </summary>
/// <param name="Qn">Nominal flow in m3/h</param>
/// <param name="metroClass">Metrological class ("A" ,"B", "C" or "R#")</param>
/// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q2 or Qt flow in m3/h</returns>
public static double GetQ2Qt(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0)
{
if (string.IsNullOrEmpty(metroClass)) return Qdflt;
int metroClassRatio;
if ((metroClass[0] == 'R') && int.TryParse(metroClass.Substring(1), out metroClassRatio) && (metroClassRatio > 0))
{
return 1.6 * Qn / (double)metroClassRatio;
}
if (medium == Entities.Medium.HotWater)
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.1 * Qn) : (0.2 * Qn);
case "B": return (Qn < 15) ? (0.08 * Qn) : (0.15 * Qn);
case "C": return (Qn < 15) ? (0.06 * Qn) : (0.1 * Qn);
case "D": return (Qn < 15) ? (0.015 * Qn) : Qdflt;
default: break;
}
}
else
{
switch (metroClass)
{
case "A": return (Qn < 15) ? (0.1 * Qn) : (0.3 * Qn);
case "B": return (Qn < 15) ? (0.08 * Qn) : (0.2 * Qn);
case "C": return (Qn < 15) ? (0.015 * Qn) : (0.015 * Qn);
default: break;
}
}
return Qdflt;
}
/// <summary>
/// Get either Q4 or Qmax flow for a given Qn and metrological class
/// </summary>
/// <param name="Qn">Nominal flow in m3/h</param>
/// <param name="metroClass">Metrological class ("A" ,"B", "C" or "R#")</param>
/// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q4 or Qmax flow in m3/h</returns>
public static double GetQ4Qmax(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0)
{
if (string.IsNullOrEmpty(metroClass)) return Qdflt;
switch (metroClass[0])
{
case 'A':
case 'B':
case 'C':
case 'D':
return 2 * Qn;
case 'R':
return 1.25 * Qn;
default:
return Qdflt;
}
}
}
}
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D476ABBE-A455-4476-8A8D-3F6151217B51}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Decrypt</RootNamespace>
<AssemblyName>Decrypt</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Decrypt.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.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>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartArguments>config.xml</StartArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<StartArguments>config.xml</StartArguments>
</PropertyGroup>
</Project>
+96
View File
@@ -0,0 +1,96 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Decrypt
{
/// <summary>
/// See also:
/// https://www.fluxbytes.com/csharp/encrypt-and-decrypt-files-in-c/
/// </summary>
class Program
{
static byte[] key = new byte[] { 83, 254, 105, 64, 184, 201, 195, 127, 52, 99, 77, 45, 252, 132, 163, 156 };
static byte[] IV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 };
static void Main(string[] args)
{
if ((args.Length < 1) || !File.Exists(args[0]))
{
Console.WriteLine("Usage: Decode <file>");
Console.ReadKey();
return;
}
string fileName = args[0];
string intermediateFile = fileName + ".plain"; /// Intermediate file, output of cryptography decoding
string backupFile = fileName + ".bak";
try
{
using (StreamReader reader = new StreamReader(fileName))
{
if (reader.ReadLine().StartsWith("<?xml version="))
{
Console.WriteLine(string.Format("File {0} is not encrypted.", fileName));
Console.ReadKey();
return;
}
}
bool successful = false;
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
{
using (FileStream fsCrypt = new FileStream(fileName, FileMode.Open))
{
using (FileStream fsOut = new FileStream(intermediateFile, FileMode.Create))
{
using (ICryptoTransform decryptor = aes.CreateDecryptor(key, IV))
{
using (CryptoStream cs = new CryptoStream(fsCrypt, decryptor, CryptoStreamMode.Read))
{
int data;
while ((data = cs.ReadByte()) != -1)
{
if (data != 0) fsOut.WriteByte((byte)data);
}
successful = true;
}
}
}
}
}
if (successful)
{
/// File decryption successfuly completed => rotate files
if (File.Exists(backupFile)) File.Delete(backupFile);
File.Move(fileName, backupFile);
File.Move(intermediateFile, fileName);
return;
}
else
{
Failed(fileName, intermediateFile, "");
return;
}
}
catch (Exception e)
{
Failed(fileName, intermediateFile, e.Message);
return;
}
}
static void Failed(string fileName, string toBeDeleted, string message)
{
if (File.Exists(toBeDeleted))
{
File.Delete(toBeDeleted);
}
Console.WriteLine(string.Format("Decryption of file {0} failed: {1}", fileName, message));
Console.ReadKey();
}
}
}
+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("Decrypt")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Decrypt")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[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("c17ec788-0e12-4f9c-aadf-ea4e83a9f373")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+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 -25
View File
@@ -7,7 +7,6 @@ using System.Threading;
using System.Windows.Forms;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
using TBF.BenchControl.GenericDevices;
using System.Xml.Serialization;
@@ -27,11 +26,11 @@ namespace DeviceTest
IComponentCfg component2Cfg;
IComponentCfg component3Cfg;
static IList<TBF.BenchControl.Generic.IDevice> tbfDevices;
static IList<TBF.BenchControl.Generic.IComponent> tbfComponents;
static TBF.BenchControl.Generic.IComponent tbfComponent1forOp;
static TBF.BenchControl.Generic.IComponent tbfComponent2forOp;
static TBF.BenchControl.Generic.IComponent tbfComponent3forOp;
static IList<IDevice> tbfDevices;
static IList<IComponent> tbfComponents;
static IComponent tbfComponent1forOp;
static IComponent tbfComponent2forOp;
static IComponent tbfComponent3forOp;
static Thread workerThread;
static bool workerThreadRunning;
@@ -56,7 +55,10 @@ namespace DeviceTest
static TBF.Boxes.FloatBox floatBox;
static Event evnt;
static TBF.Boxes.DoubleBox dblBox1;
static TBF.Boxes.DoubleBox dblBox2;
static TBF.Boxes.DoubleBox dblBox3;
static Event evnt;
static DeviceTestDlg()
@@ -68,10 +70,10 @@ namespace DeviceTest
public DeviceTestDlg()
{
InitializeComponent();
compClasses = new List<string>();
radioButton0.Checked = true;
stopButton.Enabled = false;
compClasses = new List<string>();
foreach (var componentFactory in TbfComponents.Factories)
{
compClasses.Add(componentFactory.ClassName);
@@ -273,7 +275,14 @@ namespace DeviceTest
radioButton3.Text = "SelectTank 3";
radioButton4.Text = "SelectTank -";
}
else radioButton1.Text = "spare";
else if (className == "Modbus.QuidoRS")
{
radioButton1.Text = "Close relay 1";
radioButton2.Text = "Close relay 2";
radioButton3.Text = "Close relay 3";
radioButton4.Text = "Open all relays";
}
else radioButton1.Text = "spare";
}
///
void UpdateOperations2(string className)
@@ -293,7 +302,14 @@ namespace DeviceTest
radioButton23.Text = "SelectTank 3";
radioButton24.Text = "SelectTank -";
}
else radioButton21.Text = "spare";
else if (className == "Modbus.QuidoRS")
{
radioButton21.Text = "Close relay 1";
radioButton22.Text = "Close relay 2";
radioButton23.Text = "Close relay 3";
radioButton24.Text = "Open all relays";
}
else radioButton21.Text = "spare";
}
///
void UpdateOperations3(string className)
@@ -313,7 +329,14 @@ namespace DeviceTest
radioButton33.Text = "SelectTank 3";
radioButton34.Text = "SelectTank -";
}
else radioButton31.Text = "spare";
else if (className == "Modbus.QuidoRS")
{
radioButton31.Text = "Close relay 1";
radioButton32.Text = "Close relay 2";
radioButton33.Text = "Close relay 3";
radioButton34.Text = "Open all relays";
}
else radioButton31.Text = "spare";
}
@@ -402,7 +425,7 @@ namespace DeviceTest
cfgControl.Config = parentCfg;
cfgControl.Config.ItemNr = 0;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
cfgForm.TbfComponents = new List<Config.Entities.Component>();
cfgForm.ComponentCfgCtrl = cfgControl;
@@ -431,7 +454,7 @@ namespace DeviceTest
cfgControl.Config = component1Cfg;
cfgControl.Config.ItemNr = 1;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
///
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
@@ -465,7 +488,7 @@ namespace DeviceTest
cfgControl.Config = component2Cfg;
cfgControl.Config.ItemNr = 1;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
///
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
@@ -500,7 +523,7 @@ namespace DeviceTest
cfgControl.Config = component3Cfg;
cfgControl.Config.ItemNr = 1;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
///
IList<Config.Entities.Component> compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
@@ -657,13 +680,25 @@ namespace DeviceTest
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
}
else if (tbfComponent1forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
//operation1 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
//operation2 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
//operation3 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
//operation4 = (tbfComponent1forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
operation1 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
operation2 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
operation3 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
operation4 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
}
if (tbfComponent2forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
@@ -681,16 +716,28 @@ namespace DeviceTest
}
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
{
operation21 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation22 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
}
else if (tbfComponent2forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
//operation21 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
//operation22 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
//operation23 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
//operation24 = (tbfComponent2forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
operation21 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
operation22 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
operation23 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
operation24 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
}
if (tbfComponent3forOp is TBF.BenchControl.Modbus.PressureMeter.Meret.PressureMeter)
@@ -708,23 +755,38 @@ namespace DeviceTest
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.Easytherm.Easytherm)
{
operation31 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation32 = (tbfComponent1forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.UltrasoundLevelMeter.LevelMeter).ReadTempOp(ref dblBox3);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
//operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(1);
//operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(2);
//operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(3);
//operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.TankSelector.TankSelector).SelectTankOp(0);
}
else if (tbfComponent3forOp is TBF.BenchControl.Modbus.TankSelector.TankSelector)
{
operation31 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(1);
operation32 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(2);
operation33 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(4);
operation34 = (tbfComponent3forOp as TBF.BenchControl.Modbus.QuidoRS.QuidoRS).SetOutputsOp(0);
}
while (workerThreadRunning)
int time = 0;
while (workerThreadRunning)
{
Thread.Sleep(1000);
if (workerThreadRunning)
StateMachine.Time = ++time;
if (workerThreadRunning)
{
foreach (var d in tbfDevices) d.RunDeviceBefore();
+2 -2
View File
@@ -72,10 +72,10 @@ namespace DeviceTest
}
/// Configure and start logging
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(LocAppDataDir + log4netConfigFName));
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Path.Combine(LocAppDataDir, log4netConfigFName)));
log = LogManager.GetLogger(typeof(Program));
log.Fatal("--------------------------------------------------------------------------------");
log.Fatal(string.Format("TBF ver.{0}", Version));
log.FatalFormat("DeviceTest ver.{0}", Version);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DA9B09F3-A99D-4883-A954-537560453674}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Encrypt</RootNamespace>
<AssemblyName>Encrypt</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Encrypt.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.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>
+93
View File
@@ -0,0 +1,93 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Encrypt
{
/// <summary>
/// See also:
/// https://www.fluxbytes.com/csharp/encrypt-and-decrypt-files-in-c/
/// </summary>
class Program
{
static byte[] key = new byte[] { 83, 254, 105, 64, 184, 201, 195, 127, 52, 99, 77, 45, 252, 132, 163, 156 };
static byte[] IV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 };
static void Main(string[] args)
{
if ((args.Length < 1) || !File.Exists(args[0]))
{
Console.WriteLine("Usage: Encode <file>");
Console.ReadKey();
return;
}
string fileName = args[0];
string intermediateFile = fileName + ".encrypted"; /// Intermediate file, output of cryptography encoding
string backupFile = fileName + ".bak";
try
{
using (StreamReader reader = new StreamReader(fileName))
{
if (!reader.ReadLine().StartsWith("<?xml version="))
{
Console.WriteLine(string.Format("File {0} is already encrypted.", fileName));
Console.ReadKey();
return;
}
}
bool successful = false;
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
{
using (FileStream fsCrypt = new FileStream(intermediateFile, FileMode.Create))
{
using (ICryptoTransform encryptor = aes.CreateEncryptor(key, IV))
{
using (CryptoStream cs = new CryptoStream(fsCrypt, encryptor, CryptoStreamMode.Write))
{
using (FileStream fsIn = new FileStream(fileName, FileMode.Open))
{
int data;
while ((data = fsIn.ReadByte()) != -1) cs.WriteByte((byte)data);
successful = true;
}
}
}
}
}
if (successful)
{
/// File encryption successfuly completed => rotate files
if (File.Exists(backupFile)) File.Delete(backupFile);
File.Move(fileName, backupFile);
File.Move(intermediateFile, fileName);
return;
}
else
{
Failed(fileName, intermediateFile);
return;
}
}
catch (Exception)
{
Failed(fileName, intermediateFile);
return;
}
}
static void Failed(string fileName, string toBeDeleted)
{
if (File.Exists(toBeDeleted))
{
File.Delete(toBeDeleted);
}
Console.WriteLine(string.Format("Encryption of file {0} failed.", fileName));
Console.ReadKey();
}
}
}
+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("Encrypt")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Encrypt")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[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("0f602531-6f1f-416e-af4d-9242855715a8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+94
View File
@@ -0,0 +1,94 @@
using System;
using System.Text;
namespace GemCard
{
/// <summary>
/// This class represents a command APDU
/// </summary>
public class APDUCommand
{
/// <summary>
/// Minimun size of an APDU command in bytes
/// </summary>
public const int APDU_MIN_LENGTH = 4;
public byte Class; /// Class byte
public byte Ins; /// Instruction byte
public byte P1; /// Parameter P1 byte
public byte P2; /// Parameter P2 byte
public byte[] Data; /// Data to send to the card if any, null if no data to send
public byte Le; /// Number of data expected, 0 if none
/// <summary>
/// Constructor
/// </summary>
/// <param name="bCla">Class byte</param>
/// <param name="bIns">Instruction byte</param>
/// <param name="bP1">Parameter P1 byte</param>
/// <param name="bP2">Parameter P2 byte</param>
/// <param name="baData">Data to send to the card if any, null if no data to send</param>
/// <param name="bLe">Number of data expected, 0 if none</param>
public APDUCommand(byte bCla, byte bIns, byte bP1, byte bP2, byte[] baData, byte bLe)
{
this.Class = bCla;
this.Ins = bIns;
this.P1 = bP1;
this.P2 = bP2;
this.Data = baData;
this.Le = bLe;
}
/// <summary>
/// Update the current APDU with selected parameters
/// </summary>
/// <param name="apduParam">APDU parameters</param>
public void Update(APDUParam apduParam)
{
if (apduParam.UseData) Data = apduParam.Data;
if (apduParam.UseLe) Le = apduParam.Le;
if (apduParam.UseP1) P1 = apduParam.P1;
if (apduParam.UseP2) P2 = apduParam.P2;
if (apduParam.UseChannel) Class += apduParam.Channel;
}
/// <summary>
/// Overrides the ToString method to format to a string the APDUCommand object
/// </summary>
/// <returns></returns>
public override string ToString()
{
string strData = null;
byte bLc = 0;
byte bP3 = Le;
if (Data != null)
{
StringBuilder sData = new StringBuilder(Data.Length * 2);
for (int nI = 0; nI < Data.Length; nI++)
{
sData.AppendFormat("{0:X02}", Data[nI]);
}
strData = "Data=" + sData.ToString();
bLc = (byte) Data.Length;
bP3 = bLc;
}
//string strApdu = string.Format("Class={0:X02} Ins={1:X02} P1={2:X02} P2={3:X02} Le={4:X02} Lc={5:X02} ",
//m_bCla, m_bIns, m_bP1, m_bP2, m_bLe, bLc);
StringBuilder strApdu = new StringBuilder();
strApdu.AppendFormat("Class={0:X02} Ins={1:X02} P1={2:X02} P2={3:X02} P3={4:X02} ",
Class, Ins, P1, P2, bP3);
if (Data != null)
{
strApdu.Append(strData);
}
return strApdu.ToString();
}
}
}
+147
View File
@@ -0,0 +1,147 @@
using System;
namespace GemCard
{
/// <summary>
/// This class is used to update a set of parameters of an APDUCommand object
/// </summary>
public class APDUParam
{
byte bClass;
byte bChannel;
byte bP2;
byte bP1;
byte[] baData;
short nLe;
bool fUseP1;
bool fUseP2;
bool fChannel;
bool fData;
bool fClass;
bool fLe;
/// <summary>
/// Resets the current instance, all flags are set to false
/// </summary>
public void Reset()
{
bClass = 0;
bChannel = 0;
bP2 = 0;
bP1 = 0;
baData = null;
nLe = -1;
fUseP1 = false;
fUseP2 = false;
fChannel = false;
fData = false;
fClass = false;
fLe = false;
}
#region Constructors
public APDUParam()
{
Reset();
}
/// <summary>
/// Copy constructor (used for cloning)
/// </summary>
/// <param name="param"></param>
public APDUParam(APDUParam param)
{
// Copy field
if (param.baData != null)
{
param.baData.CopyTo(baData, 0);
}
this.bClass = param.bClass;
this.bChannel = param.bChannel;
this.bP1 = param.bP1;
this.bP2 = param.bP2;
this.nLe = param.nLe;
// Copy flags field
this.fChannel = param.fChannel;
this.fClass = param.fClass;
this.fData = param.fData;
this.fLe = param.fLe;
this.fUseP1 = param.fUseP1;
this.fUseP2 = param.fUseP2;
}
public APDUParam(byte bClass, byte bP1, byte bP2, byte[] baData, short nLe)
{
this.Class = bClass;
this.P1 = bP1;
this.P2 = bP2;
this.Data = baData;
this.Le = (byte)nLe;
}
#endregion
/// <summary>
/// Clones the current APDUParam instance
/// </summary>
/// <returns></returns>
public APDUParam Clone()
{
return new APDUParam(this);
}
#region Properties
public bool UseClass { get { return fClass; } }
public bool UseChannel { get { return fChannel; } }
public bool UseLe { get { return fLe; } }
public bool UseData { get { return fData; } }
public bool UseP1 { get { return fUseP1; } }
public bool UseP2 { get { return fUseP2; } }
public byte P1
{
get { return bP1; }
set { bP1 = value; fUseP1 = true; }
}
public byte P2
{
get { return bP2; }
set { bP2 = value; fUseP2 = true; }
}
public byte[] Data
{
get { return baData; }
set { baData = value; fData = true; }
}
public byte Le
{
get { return (byte)nLe; }
set { nLe = value; fLe = true; }
}
public byte Channel
{
get { return bChannel; }
set { bChannel = value; fChannel = true; }
}
public byte Class
{
get { return bClass; }
set { bClass = value; fClass = true; }
}
#endregion
}
}
+74
View File
@@ -0,0 +1,74 @@
using System;
using System.Text;
namespace GemCard
{
/// <summary>
/// This class represents the APDU response sent by the card
/// </summary>
public class APDUResponse
{
/// <summary>
/// Status bytes length
/// </summary>
public const int SW_LENGTH = 2;
/// <summary>
/// Response data. Contains the data sent by the card minus the 2 status bytes (SW1, SW2)
/// null if no data were sent by the card
/// </summary>
public byte[] Data;
public byte SW1;
public byte SW2;
/// <summary>
/// Status get property
/// </summary>
public ushort Status
{
get { return (ushort)(((short)SW1 << 8) + (short)SW2); }
}
/// <summary>
/// Constructor from the byte data sent back by the card
/// </summary>
/// <param name="baData">Buffer of data from the card</param>
public APDUResponse(byte[] baData)
{
if (baData.Length > SW_LENGTH)
{
Data = new byte[baData.Length - SW_LENGTH];
for (int nI = 0; nI < baData.Length - SW_LENGTH; nI++)
{
this.Data[nI] = baData[nI];
}
}
this.SW1 = baData[baData.Length - 2];
this.SW2 = baData[baData.Length - 1];
}
/// <summary>
/// Overrides the ToString method to format to a string the APDUResponse object
/// </summary>
/// <returns></returns>
public override string ToString()
{
if (Data != null)
{
StringBuilder sData = new StringBuilder(Data.Length * 2);
for (int nI = 0; nI < Data.Length; nI++)
{
sData.AppendFormat("{0:X02}", Data[nI]);
}
return sData.ToString();
}
else
{
return string.Empty;
}
}
}
}
+58
View File
@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// 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("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// 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.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
+162
View File
@@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace GemCard
{
/// <summary>
/// Values for AttrId of SCardGetAttrib
/// </summary>
public class SCARD_ATTR_VALUE
{
private const uint
SCARD_CLASS_COMMUNICATIONS = 2,
SCARD_CLASS_PROTOCOL = 3,
SCARD_CLASS_MECHANICAL = 6,
SCARD_CLASS_VENDOR_DEFINED = 7,
SCARD_CLASS_IFD_PROTOCOL = 8,
SCARD_CLASS_ICC_STATE = 9,
SCARD_CLASS_SYSTEM = 0x7fff;
private static UInt32 SCardAttrValue(UInt32 attrClass, UInt32 val)
{
return (attrClass << 16) | val;
}
public static UInt32 CHANNEL_ID { get { return SCardAttrValue(SCARD_CLASS_COMMUNICATIONS, 0x0110); } }
public static UInt32 CHARACTERISTICS { get { return SCardAttrValue(SCARD_CLASS_MECHANICAL, 0x0150); } }
public static UInt32 CURRENT_PROTOCOL_TYPE { get { return SCardAttrValue(SCARD_CLASS_IFD_PROTOCOL, 0x0201); } }
public static UInt32 DEVICE_UNIT { get { return SCardAttrValue(SCARD_CLASS_SYSTEM, 0x0001); } }
public static UInt32 DEVICE_FRIENDLY_NAME { get { return SCardAttrValue(SCARD_CLASS_SYSTEM, 0x0003); } }
public UInt32 DEVICE_SYSTEM_NAME { get { return SCardAttrValue(SCARD_CLASS_SYSTEM, 0x0004); } }
public static UInt32 ICC_PRESENCE { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0300); } }
public static UInt32 ICC_INTERFACE_STATUS { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0301); } }
public static UInt32 ATR_STRING { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0303); } }
public static UInt32 ICC_TYPE_PER_ATR { get { return SCardAttrValue(SCARD_CLASS_ICC_STATE, 0x0304); } }
public static UInt32 PROTOCOL_TYPES { get { return SCardAttrValue(SCARD_CLASS_PROTOCOL, 0x0120); } }
public static UInt32 VENDOR_NAME { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0100); } }
public static UInt32 VENDOR_IFD_TYPE { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0101); } }
public static UInt32 VENDOR_IFD_VERSION { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0102); } }
public static UInt32 VENDOR_IFD_SERIAL_NO { get { return SCardAttrValue(SCARD_CLASS_VENDOR_DEFINED, 0x0103); } }
}
/// <summary>
/// Abstract class that adds a basic event management to the ICard interface.
/// </summary>
abstract public class CardBase : ICard
{
protected const uint INFINITE = 0xFFFFFFFF;
protected const uint WAIT_TIME = 250;
protected bool m_bRunCardDetection = true;
protected Thread m_thread = null;
/// <summary>
/// Event handler for the card insertion
/// </summary>
public event EventHandler<CardInsertedEventArgs> OnCardInserted = null;
/// <summary>
/// Event handler for the card removal
/// </summary>
public event EventHandler<CardRemovedEventArgs> OnCardRemoved = null;
~CardBase()
{
// Stop any eventual card detection thread
StopCardEvents();
}
#region Abstract method that implement the ICard interface
abstract public string[] ListReaders();
abstract public void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols);
abstract public void Disconnect(DISCONNECT Disposition);
abstract public APDUResponse Transmit(APDUCommand ApduCmd);
abstract public void BeginTransaction();
abstract public void EndTransaction(DISCONNECT Disposition);
abstract public byte[] GetAttribute(UInt32 AttribId);
#endregion
/// <summary>
/// This method should start a thread that checks for card insertion or removal
/// </summary>
/// <param name="Reader"></param>
public void StartCardEvents(string Reader)
{
if (m_thread == null)
{
m_bRunCardDetection = true;
m_thread = new Thread(new ParameterizedThreadStart(RunCardDetection));
m_thread.Start(Reader);
}
}
/// <summary>
/// Stops the card events thread
/// </summary>
public void StopCardEvents()
{
if (m_thread != null)
{
int
nTimeOut = 10,
nCount = 0;
bool m_bStop = false;
m_bRunCardDetection = false;
do
{
if (nCount > nTimeOut)
{
m_thread.Abort();
break;
}
if (m_thread.ThreadState == ThreadState.Aborted)
m_bStop = true;
if (m_thread.ThreadState == ThreadState.Stopped)
m_bStop = true;
Thread.Sleep(200);
++nCount; // Manage time out
}
while (!m_bStop);
m_thread = null;
}
}
/// <summary>
/// This function must implement a card detection mechanism.
///
/// When card insertion is detected, it must call the method CardInserted()
/// When card removal is detected, it must call the method CardRemoved()
///
/// </summary>
/// <param name="Reader">Name of the reader to scan for card event</param>
abstract protected void RunCardDetection(object Reader);
#region Event methods
protected void CardInserted(object sender, CardInsertedEventArgs args)
{
if (OnCardInserted != null) OnCardInserted(sender, args);
}
protected void CardRemoved(object sender, CardRemovedEventArgs args)
{
if (OnCardRemoved != null) OnCardRemoved(sender, args);
}
#endregion
}
}
+173
View File
@@ -0,0 +1,173 @@
using System;
using System.Runtime.InteropServices;
using SCARDSSPLib;
using GemCardExLib;
namespace GemCard
{
/// <summary>
/// Implements the ICard interface using the SCard COM objects from Microsoft and SCardDatabaseEx object
/// for the ListReaders function.
/// </summary>
public class CardCOM : CardBase
{
private ISCard m_itfCard = null;
/// <summary>
/// Default constructor
/// </summary>
public CardCOM()
{
// Create the SCard object
m_itfCard = new CSCardClass();
}
#region ICard Members
/// <summary>
/// Wraps the PCSC function
/// LONG SCardListReaders(SCARDCONTEXT hContext,
/// LPCTSTR mszGroups,
/// LPTSTR mszReaders,
/// LPDWORD pcchReaders
/// );
/// </summary>
/// <returns>A string array of the readers</returns>
public override string[] ListReaders()
{
ISCardDatabaseEx itfCardBase = new SCardDatabaseEx();
return (string[]) itfCardBase.ListReaders();
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardConnect(
/// IN SCARDCONTEXT hContext,
/// IN LPCTSTR szReader,
/// IN DWORD dwShareMode,
/// IN DWORD dwPreferredProtocols,
/// OUT LPSCARDHANDLE phCard,
/// OUT LPDWORD pdwActiveProtocol
/// );
/// </summary>
/// <param name="Reader"></param>
/// <param name="ShareMode"></param>
/// <param name="PreferredProtocols"></param>
public override void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols)
{
// Calls AttachReader to connect to the card
m_itfCard.AttachByReader(Reader, (SCARD_SHARE_MODES) ShareMode, (SCARD_PROTOCOLS) PreferredProtocols);
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardDisconnect(
/// IN SCARDHANDLE hCard,
/// IN DWORD dwDisposition
/// );
/// </summary>
/// <param name="Disposition"></param>
public override void Disconnect(DISCONNECT Disposition)
{
// Off the connection with the card
m_itfCard.Detach((SCARD_DISPOSITIONS) Disposition);
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardTransmit(
/// SCARDHANDLE hCard,
/// LPCSCARD_I0_REQUEST pioSendPci,
/// LPCBYTE pbSendBuffer,
/// DWORD cbSendLength,
/// LPSCARD_IO_REQUEST pioRecvPci,
/// LPBYTE pbRecvBuffer,
/// LPDWORD pcbRecvLength
/// );
/// </summary>
/// <param name="ApduCmd">APDUCommand object with the APDU to send to the card</param>
/// <returns>An APDUResponse object with the response from the card</returns>
public override APDUResponse Transmit(APDUCommand ApduCmd)
{
CSCardCmd itfCmd = new CSCardCmdClass();
CByteBuffer itfData = new CByteBufferClass();
int nLe = ApduCmd.Le;
if (ApduCmd.Data == null)
{
itfData.SetSize(0);
}
else
{
int nWrite = 0;
itfData.SetSize(ApduCmd.Data.Length);
itfData.Write(ref ApduCmd.Data[0], ApduCmd.Data.Length, ref nWrite);
}
// Build the APDU command
itfCmd.BuildCmd(ApduCmd.Class, ApduCmd.Ins, ApduCmd.P1, ApduCmd.P2, itfData, ref nLe);
// Send the command
m_itfCard.Transaction(ref itfCmd);
// Analyse the response
int nRead = 0;
byte[] pbResp = new byte[itfCmd.ApduReplyLength];
itfCmd.ApduReply.Read(ref pbResp[0], itfCmd.ApduReplyLength, ref nRead);
return new APDUResponse(pbResp);
}
/// <summary>
/// Wraps the PSCS function
/// LONG SCardBeginTransaction(
/// SCARDHANDLE hCard
// );
/// This function is not supported in the COM implementation
/// </summary>
public override void BeginTransaction()
{
throw new NotImplementedException("BeginTransaction is not supported in the COM implementation");
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardEndTransaction(
/// SCARDHANDLE hCard,
/// DWORD dwDisposition
/// );
/// This function is not supported in the COM implementation
/// </summary>
/// <param name="Disposition">A value from DISCONNECT enum</param>
public override void EndTransaction(DISCONNECT Disposition)
{
throw new NotImplementedException("EndTransaction is not supported in the COM implementation");
}
/// <summary>
/// Gets the attributes of the card
/// </summary>
/// <param name="AttribId">Identifier for the Attribute to get</param>
/// <returns>Attribute content</returns>
public override byte[] GetAttribute(UInt32 AttribId)
{
throw new NotImplementedException();
}
#endregion
/// <summary>
/// This function must implement a card detection mechanism.
///
/// When card insertion is detected, it must call the method CardInserted()
/// When card removal is detected, it must call the method CardRemoved()
///
/// </summary>
protected override void RunCardDetection(object Reader)
{
throw new Exception("The method or operation is not implemented.");
}
}
}
+9
View File
@@ -0,0 +1,9 @@
using System;
namespace GemCard
{
public class CardInsertedEventArgs : EventArgs
{
public CardInsertedEventArgs() { }
}
}
+620
View File
@@ -0,0 +1,620 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace GemCard
{
/// <summary>
/// CARD_STATE enumeration, used by the PC/SC function SCardGetStatusChanged
/// </summary>
enum CARD_STATE
{
UNAWARE = 0x00000000,
IGNORE = 0x00000001,
CHANGED = 0x00000002,
UNKNOWN = 0x00000004,
UNAVAILABLE = 0x00000008,
EMPTY = 0x00000010,
PRESENT = 0x00000020,
ATRMATCH = 0x00000040,
EXCLUSIVE = 0x00000080,
INUSE = 0x00000100,
MUTE = 0x00000200,
UNPOWERED = 0x00000400
}
/// <summary>
/// Wraps the SCARD_IO_STRUCTURE
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct SCard_IO_Request
{
public UInt32 m_dwProtocol;
public UInt32 m_cbPciLength;
}
/// <summary>
/// Wraps theSCARD_READERSTATE structure of PC/SC
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct SCard_ReaderState
{
public string m_szReader;
public IntPtr m_pvUserData;
public UInt32 m_dwCurrentState;
public UInt32 m_dwEventState;
public UInt32 m_cbAtr;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)]
public byte[] m_rgbAtr;
}
/// <summary>
/// Implementation of ICard using native (P/Invoke) interoperability for PC/SC
/// </summary>
public class CardNative : CardBase
{
private UInt32 m_hContext = 0;
private UInt32 m_hCard = 0;
private UInt32 m_nProtocol = (uint) PROTOCOL.T0;
private int m_nLastError = 0;
#region PCSC_FUNCTIONS
/// <summary>
/// Native SCardGetStatusChanged from winscard.dll
/// </summary>
/// <param name="hContext"></param>
/// <param name="dwTimeout"></param>
/// <param name="rgReaderStates"></param>
/// <param name="cReaders"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError = true)]
internal static extern int SCardGetStatusChange(UInt32 hContext,
UInt32 dwTimeout,
[In,Out] SCard_ReaderState[] rgReaderStates,
UInt32 cReaders);
/// <summary>
/// Native SCardListReaders function from winscard.dll
/// </summary>
/// <param name="hContext"></param>
/// <param name="mszGroups"></param>
/// <param name="mszReaders"></param>
/// <param name="pcchReaders"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError=true)]
internal static extern int SCardListReaders(UInt32 hContext,
[MarshalAs(UnmanagedType.LPTStr)] string mszGroups,
IntPtr mszReaders,
out UInt32 pcchReaders);
/// <summary>
/// Native SCardEstablishContext function from winscard.dll
/// </summary>
/// <param name="dwScope"></param>
/// <param name="pvReserved1"></param>
/// <param name="pvReserved2"></param>
/// <param name="phContext"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError=true)]
internal static extern int SCardEstablishContext(UInt32 dwScope,
IntPtr pvReserved1,
IntPtr pvReserved2,
IntPtr phContext);
/// <summary>
/// Native SCardReleaseContext function from winscard.dll
/// </summary>
/// <param name="hContext"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError=true)]
internal static extern int SCardReleaseContext(UInt32 hContext);
/// <summary>
/// Native SCardConnect function from winscard.dll
/// </summary>
/// <param name="hContext"></param>
/// <param name="szReader"></param>
/// <param name="dwShareMode"></param>
/// <param name="dwPreferredProtocols"></param>
/// <param name="phCard"></param>
/// <param name="pdwActiveProtocol"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError=true, CharSet=CharSet.Auto)]
internal static extern int SCardConnect(UInt32 hContext,
[MarshalAs(UnmanagedType.LPTStr)] string szReader,
UInt32 dwShareMode,
UInt32 dwPreferredProtocols,
IntPtr phCard,
IntPtr pdwActiveProtocol);
/// <summary>
/// Native SCardDisconnect function from winscard.dll
/// </summary>
/// <param name="hCard"></param>
/// <param name="dwDisposition"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError=true)]
internal static extern int SCardDisconnect(UInt32 hCard,
UInt32 dwDisposition);
/// <summary>
/// Native SCardTransmit function from winscard.dll
/// </summary>
/// <param name="hCard"></param>
/// <param name="pioSendPci"></param>
/// <param name="pbSendBuffer"></param>
/// <param name="cbSendLength"></param>
/// <param name="pioRecvPci"></param>
/// <param name="pbRecvBuffer"></param>
/// <param name="pcbRecvLength"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError=true)]
internal static extern int SCardTransmit(UInt32 hCard,
[In] ref SCard_IO_Request pioSendPci,
byte[] pbSendBuffer,
UInt32 cbSendLength,
IntPtr pioRecvPci,
[Out] byte[] pbRecvBuffer,
out UInt32 pcbRecvLength
);
/// <summary>
/// Native SCardBeginTransaction function of winscard.dll
/// </summary>
/// <param name="hContext"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError = true)]
internal static extern int SCardBeginTransaction(UInt32 hContext);
/// <summary>
/// Native SCardEndTransaction function of winscard.dll
/// </summary>
/// <param name="hContext"></param>
/// <returns></returns>
[DllImport("winscard.dll", SetLastError = true)]
internal static extern int SCardEndTransaction(UInt32 hContext, UInt32 dwDisposition);
[DllImport("winscard.dll", SetLastError = true)]
internal static extern int SCardGetAttrib(UInt32 hCard,
UInt32 dwAttribId,
[Out] byte[] pbAttr,
out UInt32 pcbAttrLen);
#endregion
/// <summary>
/// Default constructor
/// </summary>
public CardNative()
{
}
/// <summary>
/// Object destruction
/// </summary>
~CardNative()
{
Disconnect(DISCONNECT.Unpower);
ReleaseContext();
}
#region ICard Members
/// <summary>
/// Wraps the PCSC function
/// LONG SCardListReaders(SCARDCONTEXT hContext,
/// LPCTSTR mszGroups,
/// LPTSTR mszReaders,
/// LPDWORD pcchReaders
/// );
/// </summary>
/// <returns>A string array of the readers</returns>
public override string[] ListReaders()
{
EstablishContext(SCOPE.User);
string[] sListReaders = null;
UInt32 pchReaders = 0;
IntPtr szListReaders = IntPtr.Zero;
m_nLastError = SCardListReaders(m_hContext, null, szListReaders, out pchReaders);
if (m_nLastError == 0)
{
szListReaders = Marshal.AllocHGlobal((int) pchReaders);
m_nLastError = SCardListReaders(m_hContext, null, szListReaders, out pchReaders);
if (m_nLastError == 0)
{
char[] caReadersData = new char[pchReaders];
int nbReaders = 0;
for (int nI = 0; nI < pchReaders; nI++)
{
caReadersData[nI] = (char) Marshal.ReadByte(szListReaders, nI);
if (caReadersData[nI] == 0)
nbReaders++;
}
// Remove last 0
--nbReaders;
if (nbReaders != 0)
{
sListReaders = new string[nbReaders];
char[] caReader = new char[pchReaders];
int nIdx = 0;
int nIdy = 0;
int nIdz = 0;
// Get the nJ string from the multi-string
while(nIdx < pchReaders - 1)
{
caReader[nIdy] = caReadersData[nIdx];
if (caReader[nIdy] == 0)
{
sListReaders[nIdz] = new string(caReader, 0, nIdy);
++nIdz;
nIdy = 0;
caReader = new char[pchReaders];
}
else
++nIdy;
++nIdx;
}
}
}
Marshal.FreeHGlobal(szListReaders);
}
ReleaseContext();
return sListReaders;
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardEstablishContext(
/// IN DWORD dwScope,
/// IN LPCVOID pvReserved1,
/// IN LPCVOID pvReserved2,
/// OUT LPSCARDCONTEXT phContext
/// );
/// </summary>
/// <param name="Scope"></param>
public void EstablishContext(SCOPE Scope)
{
IntPtr hContext = Marshal.AllocHGlobal(Marshal.SizeOf(m_hContext));
m_nLastError = SCardEstablishContext((uint) Scope, IntPtr.Zero, IntPtr.Zero, hContext);
if (m_nLastError != 0)
{
string msg = "SCardEstablishContext error: " + m_nLastError;
Marshal.FreeHGlobal(hContext);
throw new Exception(msg);
}
m_hContext = (uint) Marshal.ReadInt32(hContext);
Marshal.FreeHGlobal(hContext);
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardReleaseContext(
/// IN SCARDCONTEXT hContext
/// );
/// </summary>
public void ReleaseContext()
{
if (m_hContext != 0)
{
m_nLastError = SCardReleaseContext(m_hContext);
if (m_nLastError != 0)
{
string msg = "SCardReleaseContext error: " + m_nLastError;
throw new Exception(msg);
}
m_hContext = 0;
}
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardConnect(
/// IN SCARDCONTEXT hContext,
/// IN LPCTSTR szReader,
/// IN DWORD dwShareMode,
/// IN DWORD dwPreferredProtocols,
/// OUT LPSCARDHANDLE phCard,
/// OUT LPDWORD pdwActiveProtocol
/// );
/// </summary>
/// <param name="Reader"></param>
/// <param name="ShareMode"></param>
/// <param name="PreferredProtocols"></param>
public override void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols)
{
EstablishContext(SCOPE.User);
IntPtr hCard = Marshal.AllocHGlobal(Marshal.SizeOf(m_hCard));
IntPtr pProtocol = Marshal.AllocHGlobal(Marshal.SizeOf(m_nProtocol));
m_nLastError = SCardConnect(m_hContext,
Reader,
(uint) ShareMode,
(uint) PreferredProtocols,
hCard,
pProtocol);
if (m_nLastError != 0)
{
string msg = "SCardConnect error: " + m_nLastError;
Marshal.FreeHGlobal(hCard);
Marshal.FreeHGlobal(pProtocol);
throw new Exception(msg);
}
m_hCard = (uint) Marshal.ReadInt32(hCard);
m_nProtocol = (uint) Marshal.ReadInt32(pProtocol);
Marshal.FreeHGlobal(hCard);
Marshal.FreeHGlobal(pProtocol);
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardDisconnect(
/// IN SCARDHANDLE hCard,
/// IN DWORD dwDisposition
/// );
/// </summary>
/// <param name="Disposition"></param>
public override void Disconnect(DISCONNECT Disposition)
{
if (m_hCard != 0)
{
m_nLastError = SCardDisconnect(m_hCard, (uint) Disposition);
m_hCard = 0;
if (m_nLastError != 0)
{
string msg = "SCardDisconnect error: " + m_nLastError;
throw new Exception(msg);
}
ReleaseContext();
}
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardTransmit(
/// SCARDHANDLE hCard,
/// LPCSCARD_I0_REQUEST pioSendPci,
/// LPCBYTE pbSendBuffer,
/// DWORD cbSendLength,
/// LPSCARD_IO_REQUEST pioRecvPci,
/// LPBYTE pbRecvBuffer,
/// LPDWORD pcbRecvLength
/// );
/// </summary>
/// <param name="ApduCmd">APDUCommand object with the APDU to send to the card</param>
/// <returns>An APDUResponse object with the response from the card</returns>
public override APDUResponse Transmit(APDUCommand ApduCmd)
{
uint RecvLength = (uint) (ApduCmd.Le + APDUResponse.SW_LENGTH);
byte[] ApduBuffer = null;
byte[] ApduResponse = new byte[ApduCmd.Le + APDUResponse.SW_LENGTH];
SCard_IO_Request ioRequest = new SCard_IO_Request();
ioRequest.m_dwProtocol = m_nProtocol;
ioRequest.m_cbPciLength = 8;
// Build the command APDU
if (ApduCmd.Data == null)
{
ApduBuffer = new byte[APDUCommand.APDU_MIN_LENGTH + ((ApduCmd.Le != 0) ? 1 : 0)];
if (ApduCmd.Le != 0)
ApduBuffer[4] = (byte) ApduCmd.Le;
}
else
{
ApduBuffer = new byte[APDUCommand.APDU_MIN_LENGTH + 1 + ApduCmd.Data.Length];
for (int nI = 0; nI < ApduCmd.Data.Length; nI++)
ApduBuffer[APDUCommand.APDU_MIN_LENGTH + 1 + nI] = ApduCmd.Data[nI];
ApduBuffer[APDUCommand.APDU_MIN_LENGTH] = (byte) ApduCmd.Data.Length;
}
ApduBuffer[0] = ApduCmd.Class;
ApduBuffer[1] = ApduCmd.Ins;
ApduBuffer[2] = ApduCmd.P1;
ApduBuffer[3] = ApduCmd.P2;
m_nLastError = SCardTransmit(m_hCard, ref ioRequest, ApduBuffer, (uint) ApduBuffer.Length, IntPtr.Zero, ApduResponse, out RecvLength);
if (m_nLastError != 0)
{
string msg = "SCardTransmit error: " + m_nLastError;
throw new Exception(msg);
}
byte[] ApduData = new byte[RecvLength];
for (int nI = 0; nI < RecvLength; nI++)
ApduData[nI] = ApduResponse[nI];
return new APDUResponse(ApduData);
}
/// <summary>
/// Wraps the PSCS function
/// LONG SCardBeginTransaction(
/// SCARDHANDLE hCard
// );
/// </summary>
public override void BeginTransaction()
{
if (m_hCard != 0)
{
m_nLastError = SCardBeginTransaction(m_hCard);
if (m_nLastError != 0)
{
string msg = "SCardBeginTransaction error: " + m_nLastError;
throw new Exception(msg);
}
}
}
/// <summary>
/// Wraps the PCSC function
/// LONG SCardEndTransaction(
/// SCARDHANDLE hCard,
/// DWORD dwDisposition
/// );
/// </summary>
/// <param name="Disposition">A value from DISCONNECT enum</param>
public override void EndTransaction(DISCONNECT Disposition)
{
if (m_hCard != 0)
{
m_nLastError = SCardEndTransaction(m_hCard, (UInt32)Disposition);
if (m_nLastError != 0)
{
string msg = "SCardEndTransaction error: " + m_nLastError;
throw new Exception(msg);
}
}
}
/// <summary>
/// Gets the attributes of the card
/// </summary>
/// <param name="AttribId">Identifier for the Attribute to get</param>
/// <returns>Attribute content</returns>
public override byte[] GetAttribute(UInt32 AttribId)
{
byte[] attr = null;
UInt32 attrLen = 0;
m_nLastError = SCardGetAttrib(m_hCard, AttribId, attr, out attrLen);
if (m_nLastError == 0)
{
if (attrLen != 0)
{
attr = new byte[attrLen];
m_nLastError = SCardGetAttrib(m_hCard, AttribId, attr, out attrLen);
if (m_nLastError != 0)
{
string msg = "SCardGetAttr error: " + m_nLastError;
throw new Exception(msg);
}
}
}
else
{
string msg = "SCardGetAttr error: " + m_nLastError;
throw new Exception(msg);
}
return attr;
}
#endregion
/// <summary>
/// This function must implement a card detection mechanism.
///
/// When card insertion is detected, it must call the method CardInserted()
/// When card removal is detected, it must call the method CardRemoved()
///
/// </summary>
protected override void RunCardDetection(object Reader)
{
bool bFirstLoop = true;
UInt32 hContext = 0; // Local context
IntPtr phContext;
phContext = Marshal.AllocHGlobal(Marshal.SizeOf(hContext));
if (SCardEstablishContext((uint) SCOPE.User, IntPtr.Zero, IntPtr.Zero, phContext) == 0)
{
hContext = (uint)Marshal.ReadInt32(phContext);
Marshal.FreeHGlobal(phContext);
UInt32 nbReaders = 1;
SCard_ReaderState[] readerState = new SCard_ReaderState[nbReaders];
readerState[0].m_dwCurrentState = (UInt32) CARD_STATE.UNAWARE;
readerState[0].m_szReader = (string)Reader;
UInt32 eventState;
UInt32 currentState = readerState[0].m_dwCurrentState;
// Card detection loop
do
{
if (SCardGetStatusChange(hContext, WAIT_TIME
, readerState, nbReaders) == 0)
{
eventState = readerState[0].m_dwEventState;
currentState = readerState[0].m_dwCurrentState;
// Check state
if (((eventState & (uint) CARD_STATE.CHANGED) == (uint) CARD_STATE.CHANGED) && !bFirstLoop)
{
// State has changed
if ((eventState & (uint) CARD_STATE.EMPTY) == (uint) CARD_STATE.EMPTY)
{
// There is no card, card has been removed -> Fire CardRemoved event
CardRemoved(this, new CardRemovedEventArgs());
}
if (((eventState & (uint)CARD_STATE.PRESENT) == (uint)CARD_STATE.PRESENT) &&
((eventState & (uint) CARD_STATE.PRESENT) != (currentState & (uint) CARD_STATE.PRESENT)))
{
// There is a card in the reader -> Fire CardInserted event
CardInserted(this, new CardInsertedEventArgs());
}
if ((eventState & (uint) CARD_STATE.ATRMATCH) == (uint) CARD_STATE.ATRMATCH)
{
// There is a card in the reader and it matches the ATR we were expecting-> Fire CardInserted event
CardInserted(this, new CardInsertedEventArgs());
}
}
// The current stateis now the event state
readerState[0].m_dwCurrentState = eventState;
bFirstLoop = false;
}
Thread.Sleep(100);
if (m_bRunCardDetection == false)
break;
}
while (true); // Exit on request
}
else
{
Marshal.FreeHGlobal(phContext);
throw new Exception("PC/SC error");
}
SCardReleaseContext(hContext);
}
}
}
+9
View File
@@ -0,0 +1,9 @@
using System;
namespace GemCard
{
public class CardRemovedEventArgs : EventArgs
{
public CardRemovedEventArgs() { }
}
}
+179
View File
@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>GemCard</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>GemCard</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<FileAlignment>4096</FileAlignment>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<FileAlignment>4096</FileAlignment>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
</ItemGroup>
<ItemGroup>
<Compile Include="APDUCommand.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="APDUParam.cs" />
<Compile Include="APDUResponse.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CardBase.cs" />
<Compile Include="CardInsertedEventArgs.cs" />
<Compile Include="CardNative.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="CardRemovedEventArgs.cs" />
<Compile Include="ICard.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SmartCardException.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
+70
View File
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastOpenVersion>8.0.50215</LastOpenVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>
</ReferencePath>
<CopyProjectDestinationFolder>
</CopyProjectDestinationFolder>
<CopyProjectUncPath>
</CopyProjectUncPath>
<CopyProjectOption>0</CopyProjectOption>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>false</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartWithIE>true</StartWithIE>
</PropertyGroup>
</Project>
+149
View File
@@ -0,0 +1,149 @@
using System;
namespace GemCard
{
/// <summary>
/// This interface gives access to the basic card functions. It must be implemented by a class.
/// </summary>
public interface ICard
{
/// <summary>
/// Wraps the PCSC funciton
/// LONG SCardListReaders(SCARDCONTEXT hContext,
/// LPCTSTR mszGroups,
/// LPTSTR mszReaders,
/// LPDWORD pcchReaders
/// );
/// </summary>
/// <returns>A string array of the readers</returns>
string[] ListReaders();
/// <summary>
/// Wraps the PCSC function
/// LONG SCardConnect(
/// IN SCARDCONTEXT hContext,
/// IN LPCTSTR szReader,
/// IN DWORD dwShareMode,
/// IN DWORD dwPreferredProtocols,
/// OUT LPSCARDHANDLE phCard,
/// OUT LPDWORD pdwActiveProtocol
/// );
/// </summary>
/// <param name="Reader"></param>
/// <param name="ShareMode"></param>
/// <param name="PreferredProtocols"></param>
void Connect(string Reader, SHARE ShareMode, PROTOCOL PreferredProtocols);
/// <summary>
/// Wraps the PCSC function
/// LONG SCardDisconnect(
/// IN SCARDHANDLE hCard,
/// IN DWORD dwDisposition
/// );
/// </summary>
/// <param name="Disposition"></param>
void Disconnect(DISCONNECT Disposition);
/// <summary>
/// Wraps the PCSC function
/// LONG SCardTransmit(
/// SCARDHANDLE hCard,
/// LPCSCARD_I0_REQUEST pioSendPci,
/// LPCBYTE pbSendBuffer,
/// DWORD cbSendLength,
/// LPSCARD_IO_REQUEST pioRecvPci,
/// LPBYTE pbRecvBuffer,
/// LPDWORD pcbRecvLength
/// );
/// </summary>
/// <param name="ApduCmd">APDUCommand object with the APDU to send to the card</param>
/// <returns>An APDUResponse object with the response from the card</returns>
APDUResponse Transmit(APDUCommand ApduCmd);
/// <summary>
/// Wraps the PSCS function
/// LONG SCardBeginTransaction(
/// SCARDHANDLE hCard
// );
/// </summary>
void BeginTransaction();
/// <summary>
/// Wraps the PCSC function
/// LONG SCardEndTransaction(
/// SCARDHANDLE hCard,
/// DWORD dwDisposition
/// );
/// </summary>
void EndTransaction(DISCONNECT Disposition);
/// <summary>
/// Gets the attributes of the card
/// </summary>
/// <param name="AttribId">Identifier for the Attribute to get</param>
/// <returns>Attribute content</returns>
byte[] GetAttribute(UInt32 AttribId);
}
/// <summary>
/// SCOPE context
/// </summary>
public enum SCOPE
{
/// <summary>
/// The context is a user context, and any database operations are performed within the
/// domain of the user.
/// </summary>
User,
/// <summary>
/// The context is that of the current terminal, and any database operations are performed
/// within the domain of that terminal. (The calling application must have appropriate
/// access permissions for any database actions.)
/// </summary>
Terminal,
/// <summary>
/// The context is the system context, and any database operations are performed within the
/// domain of the system. (The calling application must have appropriate access
/// permissions for any database actions.)
/// </summary>
System
}
/// <summary>
/// SHARE mode enumeration
/// </summary>
public enum SHARE
{
Exclusive = 1, /// This app. is not willing to share this card with other applications.
Shared, /// This app. is willing to share this card with other applications.
Direct, /// This app. demands direct control of the reader, so it is not available to other applications.
}
/// <summary>
/// PROTOCOL enumeration
/// </summary>
public enum PROTOCOL
{
Undefined = 0x00000000, /// There is no active protocol.
T0 = 0x00000001, /// T=0 is the active protocol.
T1 = 0x00000002, /// T=1 is the active protocol.
T0orT1 = T0 | T1, /// T=1 or T=0 can be the active protocol
Raw = 0x00010000, /// Raw is the active protocol.
Default = unchecked ((int) 0x80000000), /// Use implicit PTS.
}
/// <summary>
/// DISCONNECT action enumeration
/// </summary>
public enum DISCONNECT
{
Leave, /// Don't do anything special on close
Reset, /// Reset the card on close
Unpower, /// Power down the card on close
Eject, /// Eject(!) the card on close
}
}
+40
View File
@@ -0,0 +1,40 @@
using System;
namespace GemCard
{
/// <summary>
/// Smart card exceptions
/// </summary>
public class SmartCardException : Exception
{
public SmartCardException() : base("Smart card exception")
{
}
public SmartCardException(string Message) : base(Message)
{
}
}
public class ApduCommandException : Exception
{
public const string
NotValidDocument = "The file is not a valid APDU command document",
NoSuchCommand = "No such APDU command in the document",
ParamLeFormat = "Le parameter format is not correct",
ParamP3Format = "P3 parameter format is not correct",
NoSuchSequence = "No such APDU sequence in the document",
MissingApduOrCommand = "An Apdu or a Sequence is missing in this Sequence";
public ApduCommandException() : base("APDU command exception")
{
}
public ApduCommandException(string Message) : base(Message)
{
}
}
}
+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; }
}
}
}
+115
View File
@@ -0,0 +1,115 @@
<?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="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
+298
View File
@@ -0,0 +1,298 @@
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 bool paused = false;
private bool isRunning = false;
#endregion
#region CONSTRUCTOR
public PlotterDisplayEx()
{
InitializeComponent();
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;
base.Dispose(disposing);
}
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 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();
}
}
}
+200
View File
@@ -0,0 +1,200 @@
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;
//
// 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>
+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;
}
}
}
}
+44 -13
View File
@@ -27,8 +27,8 @@ namespace Results
public Batch Batch;
public WaterMeter[] WaterMeters;
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
Config.Entities.Procedure procedure,
public static BatchResults NewFromProcedure(int batchNr, int benchId, string benchName, string a1, string a2, string a3, string a4, string a5,
string user, int userNr, string programVer, Config.Entities.Procedure procedure,
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
{
BatchResults d = new BatchResults(waterMeterDatas.Length);
@@ -37,8 +37,14 @@ namespace Results
/// Create new batch
d.Batch = new Batch()
{
TestBenchId = benchId,
BatchNr = batchNr,
BatchNr = batchNr,
TestBenchId = benchId,
TestBenchName = benchName,
Address1 = a1,
Address2 = a2,
Address3 = a3,
Address4 = a4,
Address5 = a5,
ProgramVersion = programVer,
UserName = user,
UserNumber = userNr,
@@ -46,7 +52,7 @@ 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),
@@ -90,7 +96,7 @@ namespace Results
{
if (d.WaterMeters[i] == null) continue;
if (t.Part != 0 && waterMeterParts[i] != 0 && t.Part != waterMeterParts[i]) continue;
if (!t.IsPartCompatible(waterMeterParts[i])) continue;
///
/// Create empty watermeter test results and add them to the list and to dictionaries
@@ -124,13 +130,19 @@ namespace Results
public static BatchResults FromBatch(Batch batch)
{
int wmCount = batch.WaterMeters.Count;
if (wmCount == 0) return null;
if (batch.WaterMeters == null || batch.WaterMeters.Count == 0) return null;
BatchResults batchResults = new BatchResults(wmCount);
int wmPosMax = 0;
foreach (var wm in batch.WaterMeters) if (wm.WMPosition > wmPosMax) wmPosMax = wm.WMPosition;
BatchResults batchResults = new BatchResults(wmPosMax);
batchResults.Batch = batch;
batchResults.WaterMeters = new WaterMeter[wmCount];
for (int i = 0; i < wmCount; i++) batchResults.WaterMeters[i] = batch.WaterMeters[i];
batchResults.WaterMeters = new WaterMeter[wmPosMax];
for (int i = 0; i < batch.WaterMeters.Count; i++)
{
WaterMeter wm = batch.WaterMeters[i];
batchResults.WaterMeters[wm.WMPosition - 1] = wm;
}
return batchResults;
}
@@ -158,11 +170,11 @@ namespace Results
{
for (int i = 0; i < WMPositionsCount; i++)
{
if (WaterMeters[i] != null)
if ((WaterMeters[i] != null) && !WaterMeters[i].Disabled)
{
foreach (var mtr in WaterMeters[i].MeterTestRslts)
{
if (!mtr.TestDone) return false;
if (!mtr.TestDone) return false;
}
}
}
@@ -189,5 +201,24 @@ 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") || mtr.TestData().Name.ToLower().Contains("just"))
{
return true;
}
}
}
}
return false;
}
}
}
+29 -10
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;
}
@@ -277,13 +296,13 @@ namespace Results
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>()
TestDataList = session.QueryOver<TestData>().List();
ComponentsList = session.QueryOver<Components>().List();
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
batches = session.QueryOver<Batch>()
.Where(x => (x.BatchNr == batchNr))
.List();
@@ -296,14 +315,14 @@ namespace Results
.Where(x => (x.Batch.Id == batch.Id))
.List();
}
}
return (batches.Count > 0) ? batches[0] : null;
}
catch (Exception exc)
{
log.FatalFormat("Cannot load batch #{0}: {1}", batchNr, exc.Message);
return null;
}
return (batches.Count > 0) ? batches[0] : null;
}
}
}
+96 -3
View File
@@ -11,7 +11,13 @@ namespace Results.Entities
public virtual int Id { get; protected set; }
public virtual int BatchNr { get; set; }
public virtual int TestBenchId { get; set; }
public virtual string ProgramVersion { get; set; }
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
public virtual string ProgramVersion { get; set; }
public virtual string UserName { get; set; }
public virtual int UserNumber { get; set; }
public virtual string ProcedureName { get; set; }
@@ -23,7 +29,17 @@ namespace Results.Entities
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 int Counter1 { get; set; }
public virtual int Counter2 { get; set; }
public virtual int Counter3 { get; set; }
public virtual int Counter4 { get; set; }
public virtual int Counter5 { get; set; }
public virtual int Counter6 { get; set; }
public virtual int Counter7 { get; set; }
public virtual int Counter8 { get; set; }
public virtual int Counter9 { get; set; }
public virtual int Counter10 { get; set; }
public virtual DateTime StartTime { get; set; }
public virtual DateTime EndTime { get; set; }
public virtual bool Dirty { get; set; }
public virtual bool RsltsSent { get; set; }
@@ -32,7 +48,7 @@ namespace Results.Entities
public virtual IList<WaterMeter> WaterMeters { get; set; }
public virtual IList<TestRslt> TestRslts { get; set; }
public virtual bool Compound { get; set; } /// Not mapped to DB now
public virtual bool HeatMeter { get; set; } /// Not mapped to DB now
public virtual bool HeatMeter { get; set; } /// Not mapped to DB now ///
public Batch()
{
@@ -41,6 +57,18 @@ namespace Results.Entities
TestRslts = new List<TestRslt>();
}
public virtual int PassedMetersCount()
{
int count = 0;
foreach (var mtr in WaterMeters) if (mtr.PassedFromTests()) count++;
return count;
}
public virtual int FailedMetersCount()
{
return WaterMeters.Count - PassedMetersCount();
}
public virtual double AmbTempMean()
{
double timeSum = 0;
@@ -95,6 +123,62 @@ namespace Results.Entities
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;
@@ -126,5 +210,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);
}
}
}
+37 -14
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
@@ -10,6 +10,8 @@ namespace Results.Entities
public virtual int Id { get; protected set; }
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal, 4=heat meter volume, 5=heat meter energy
public virtual int RegReaderType { get; set; } /// Not mapped to the DB, does not depend on localization and customer
public virtual double PulsesMeter { get; set; } /// # of water meter or heat meter pulses
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
public virtual double PulsesPerLiter { get; set; } /// [l ^ -1], in case of heat meters (CompoundMeterId==5) pulses per kWh in [kWh ^ -1]
@@ -23,8 +25,14 @@ namespace Results.Entities
/// Main result
public virtual double Error { get; set; } /// [%]
public virtual long ErrorIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (error flags)
public virtual long InfoIndicators { get; set; } /// Not mapped to DB !!!, bit24=E25, bit25=E26, bit26=E27, bit27=E28 (info flags)
public virtual double KorrErrQ { get; set; } /// [%] not mapped to results DB, saved to Oracle DB
public virtual bool TestDone { get; set; } /// true = test was completed
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
#if ORACLE_DB
public virtual double LastError { get; set; } /// [%] Previous test error at this Q in case Pruefindex > 1
#endif
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
@@ -37,20 +45,21 @@ namespace Results.Entities
public virtual double FlowMass() { return TestRslt.FlowMass; } /// [kg/h]
public virtual double FlowVolume() { return TestRslt.FlowVolume; } /// [m3/h]
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; } /// [%]
public virtual double DensityOut() { return TestRslt.DensityOut; }
public virtual double DensityLine() { return TestRslt.DensityLine; }
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]
public virtual double Qtg() { return TestData().Qtg; } /// [m3/h]
public virtual double Qfrom() { return TestData().Qfrom; } /// [m3/h]
public virtual double Qto() { return TestData().Qto; } /// [m3/h]
public virtual double TargetVolume() { return TestData().TargetVolume; } /// [l]
public virtual double TargetTime() { return TestData().TargetTime; } /// [s]
public virtual string Method() { return TestData().Method; }
public virtual double ErrLimLo() { return TestData().ErrLimLo; } /// [%]
public virtual double ErrLimHi() { return TestData().ErrLimHi; } /// [%]
public virtual double Uncertainty() { return TestData().Uncertainty; } /// [%]
public virtual double Uncertainty() { return TestData().ErrLimMargin; } /// [%]
public virtual string ProcedureName() { return WaterMeter.Batch.ProcedureName; }
public virtual int BatchNr() { return WaterMeter.Batch.BatchNr; }
@@ -72,16 +81,23 @@ namespace Results.Entities
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy);
}
public virtual string PassedColorStr()
public virtual bool IsPulses() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Pulses || RegReaderType == (int)Config.Entities.RegisterReaderType.Unknown); }
public virtual bool IsCamera() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Camera); }
public virtual bool IsDataStream() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.DataStream); }
public virtual bool IsManual() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Manual); }
public virtual string PassedColorStr(string yesNoFormatOrEmpty)
{
#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
}
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
{
return Utils.PassedColorStr(Passed, Evaluate());
}
else
{
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
}
}
public MeterTestRslt()
{
@@ -101,6 +117,8 @@ namespace Results.Entities
{
if (src == null) return;
CompoundMeterId = src.CompoundMeterId;
RegReaderType = src.RegReaderType;
PulsesMeter = src.PulsesMeter;
PulsesMaster = src.PulsesMaster;
PulsesPerLiter = src.PulsesPerLiter;
@@ -112,8 +130,13 @@ namespace Results.Entities
TimestampEnd = src.TimestampEnd;
TestTime = src.TestTime;
Error = src.Error;
ErrorIndicators = src.ErrorIndicators;
KorrErrQ = src.KorrErrQ;
TestDone = src.TestDone;
Passed = src.Passed;
#if ORACLE_DB
LastError = src.LastError;
#endif
}
public override string ToString()
+11 -8
View File
@@ -15,14 +15,15 @@ namespace Results.Entities
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 Qtg { get; set; } /// [m3/h] flow range low limit
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 double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double ErrLimMargin { get; set; } /// [%] makes error limits tighter: 0 <= ErrLimMargin <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
@@ -41,14 +42,15 @@ namespace Results.Entities
{
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qtg = (double)test.Qtg;
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;
ErrLimMargin = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
@@ -66,14 +68,15 @@ namespace Results.Entities
{
if (!Name.Equals(td.Name)) return false;
if (Repeats != td.Repeats) return false;
if (Qfrom != td.Qfrom) return false;
if (Qtg != td.Qtg) return false;
if (Qfrom != td.Qfrom) return false;
if (Qto != td.Qto) return false;
if (TargetVolume != td.TargetVolume) return false;
if (TargetTime != td.TargetTime) return false;
if (!Method.Equals(td.Method)) return false;
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (Uncertainty != td.Uncertainty) return false;
if (ErrLimMargin != td.ErrLimMargin) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
+178 -24
View File
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Text;
namespace Results.Entities
{
@@ -13,31 +14,51 @@ namespace Results.Entities
public virtual Batch Batch { get; set; }
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 Part { get; set; }
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
public virtual string MethodClass { get; set; } /// Not mapped to DB, does not depend on localization and customer
/// 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 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
public virtual double MassStartRaw { get; set; } /// [kg]
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] Flow set time in seconds
public virtual int TimeBtwnMassMsrmnts { get; set; } /// [s] Time between two mass measurements in seconds (if applicable)
public virtual double TestTime { get; set; } /// [s] Test time in seconds
public virtual double TestTimeCorrection { get; set; } /// [s] Correction of the test time due to diverter (0 for methods w/o diverter or when there is no correction table)
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
/// When mass measurement is not available, corrected by a correction table.
public virtual double MassStartRaw { get; set; } /// [kg]
public virtual double MassStart { get; set; } /// [kg]
public virtual double MassEndRaw { get; set; } /// [kg]
public virtual double MassEnd { get; set; } /// [kg]
public virtual double DensityIn { get; set; } /// [kg/m3]
public virtual double DensityOut { get; set; } /// [kg/m3]
public virtual double DensityLine { get; set; } /// [kg/m3]
public virtual double DensityDiv { get; set; } /// [kg/m3]
public virtual double Buoyancy { get; set; }
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
public virtual double FlowVolume { get; set; } /// [m3/h]
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%]
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
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 long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc.
/// Main results of heat meters
public virtual double RefEnergy { get; set; } /// [J] Joul
@@ -91,11 +112,17 @@ namespace Results.Entities
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 FlowMin { get; set; } /// [m3/h]
public virtual float FlowMax { get; set; } /// [m3/h]
public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty
public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale
public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density
public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature
public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure
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,7 +131,7 @@ namespace Results.Entities
public virtual float Custom8 { get; set; } /// [°C] T ref lo end
public virtual float Custom9 { get; set; } /// [°C] T ref lo min
public virtual float Custom10 { get; set; } /// [°C] T ref lo max
/// Wrappers
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
public virtual int Repeats() { return TestData.Repeats; }
@@ -113,10 +140,78 @@ namespace Results.Entities
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 Uncertainty() { return TestData.Uncertainty; }
public virtual bool Evaluate() { return TestData.Evaluate; }
public virtual string RefFlowmeter() { return (Components != null) ? Components.Flowmeter : string.Empty; }
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest") || MethodClass.Contains("ManualEntry")) : true; }
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest") || TestData.Method.ToLower().Contains("pmax")) : true; }
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
public virtual bool IsDiverter() { return (MethodClass != null) ? ((MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) || MethodClass.Contains("DiverterTest")) : true; }
public virtual bool IsVolumeMethod() { return (MethodClass != null) ? (MethodClass.Contains("TestMethods.FixedStart.") || MethodClass.Contains("TestMethods.FlyingStart.")) : false; }
public virtual string MethodElde()
{
if (MethodClass == null) return string.Empty;
else if (MethodClass.Contains("TestMethods.FlyingStartMassCollection.")) return "MS";
else if (MethodClass.Contains("TestMethods.FlyingStartMassCollectionProlonged.")) return "MS";
else if (MethodClass.Contains("TestMethods.FlyingStartMassCollectionComparative.")) return "MS";
else if (MethodClass.Contains("TestMethods.FlyingStart.")) return "VS";
else if (MethodClass.Contains("TestMethods.FixedStartMassCollection.")) return "MP";
else if (MethodClass.Contains("TestMethods.FixedStartTankCollection.")) return "VP";
else if (MethodClass.Contains("TestMethods.FixedStart.")) return "VP";
else return string.Empty;
}
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 = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return -Math.Min(3.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 = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided
/// Calculate the error limit of a heat meter
switch (metrClass)
{
default:
case 1: return +Math.Min(3.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 ErrLimMargin() { return TestData.ErrLimMargin; }
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; }
@@ -140,20 +235,25 @@ namespace Results.Entities
Components = src.Components; /// ???
Part = src.Part;
RepetitionNr = src.RepetitionNr;
TestDone = src.TestDone;
MethodClass = src.MethodClass;
TestDone = src.TestDone;
Remark = src.Remark;
StartTime = src.StartTime;
EndTime = src.EndTime;
FlowSetTime = src.FlowSetTime;
TimeBtwnMassMsrmnts = src.TimeBtwnMassMsrmnts;
TestTime = src.TestTime;
PulsesMaster = src.PulsesMaster;
ConstMaster = src.ConstMaster;
TotalPulsesMstr = src.TotalPulsesMstr;
ConstMasterRaw = src.ConstMasterRaw;
ConstMasterCorr = src.ConstMasterCorr;
ConstMaster = src.ConstMaster;
MassStartRaw = src.MassStartRaw;
MassStart = src.MassStart;
MassEndRaw = src.MassEndRaw;
MassEnd = src.MassEnd;
DensityIn = src.DensityIn;
DensityOut = src.DensityOut;
DensityLine = src.DensityLine;
DensityDiv = src.DensityDiv;
Buoyancy = src.Buoyancy;
FlowMass = src.FlowMass;
@@ -161,6 +261,16 @@ namespace Results.Entities
VolumeCTV = src.VolumeCTV;
VolumeMaster = src.VolumeMaster;
ErrorMaster = src.ErrorMaster;
DiverterStart = src.DiverterStart;
DivStart10 = src.DivStart10;
DivStart50 = src.DivStart50;
DivStart90 = src.DivStart90;
DiverterEnd = src.DiverterEnd;
DivEnd10 = src.DivEnd10;
DivEnd50 = src.DivEnd50;
DivEnd90 = src.DivEnd90;
ErrorFlags = src.ErrorFlags;
InfoFlags = src.InfoFlags;
RefEnergy = src.RefEnergy;
AmbTempMean = src.AmbTempMean;
AmbTempStart = src.AmbTempStart;
@@ -224,9 +334,53 @@ namespace Results.Entities
Custom10 = src.Custom10;
}
/// <summary> Wrapper </summary>
public virtual string ErrorFlagsStr()
{
string eFlags = Utils.ErrorFlagsStr(ErrorFlags);
#if LANG_PL
return string.IsNullOrEmpty(eFlags) ? "brak" : eFlags;
#else
return eFlags;
#endif
}
public virtual bool IsPartCompatible(int waterMeterPartNr)
{
if ((this.Part == 0) || (waterMeterPartNr == 0)) return true;
if ((this.Part % 10) == waterMeterPartNr) return true;
if (((this.Part / 10) % 10) == waterMeterPartNr) return true;
if (((this.Part / 100) % 10) == waterMeterPartNr) return true;
if (((this.Part / 1000) % 10) == waterMeterPartNr) return true;
return false;
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
}
}
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} InfoFlags={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, DensityLine, DensityDiv, Buoyancy, FlowMass, FlowVolume,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, InfoFlags,
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);
}
}
}
+323 -35
View File
@@ -5,45 +5,103 @@ using System;
using System.Collections.Generic;
using System.Text;
using Config.Entities;
using Results.Resources;
namespace Results.Entities
{
public class WaterMeter
public enum ResultCode
{
None = 0,
Bit16 = (1 << 16),
Bit17 = (1 << 17),
Bit18 = (1 << 18),
Bit19 = (1 << 19),
RfidErrorCodeMask = (Bit16 | Bit17 | Bit18 | Bit19), /// RFID comm. err. (the first encounetered error is stored)
Bit20 = (1 << 20),
Bit21 = (1 << 21),
Bit22 = (1 << 22),
Bit23 = (1 << 23),
RfidErrorTestIdMask = (Bit20 | Bit21 | Bit22 | Bit23), /// RFID comm. err. (the first encounetered error is stored)
MissingOptoData = (1 << 24),
OptoDataWithZeroFlow = (1 << 25),
OptoErrorCodeMask = (MissingOptoData | OptoDataWithZeroFlow), /// Opto comm. err. (the first encounetered error is stored)
Bit26 = (1 << 26),
Bit27 = (1 << 27),
Bit28 = (1 << 28),
Bit29 = (1 << 29),
Bit30 = (1 << 30),
Bit31 = (1 << 31),
}
public class WaterMeter
{
public virtual int Id { get; protected set; }
public virtual string SerialNr { get; set; } /// Main s/n for compound meters, PCB Number for iPerl water meter
public virtual string SerialNrAux { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual string SerialNr { get; set; } /// S/N _or_ S/N of the main meter of a compound meter _or_ PCB Number of an iPerl water meter
public virtual string SerialNrAux { get; set; } /// S/N of the aux. meter of a compound meter _or_ a complete assigned S/N of an iPerl water meter
public virtual string PurchaseOrder { get; set; }
public virtual int YearOfProduction { get; set; }
public virtual int WMPosition { get; set; }
public virtual string EndState { get; set; } /// End state (of the main water meter)
public virtual string EndStateAux { get; set; } /// End state of the auxiliary water meter
public virtual double QRise { get; set; } /// [m3/h] detected Q_rise of a composed meter
public virtual double QRise { get; set; } /// [m3/h] detected Q_rise of a composed meter or 'sensitivity' of a single meter
public virtual double QFall { get; set; } /// [m3/h] detected Q_fall of a composed meter
public virtual bool Passed { get; set; }
public virtual long ErrorFlags { get; set; } /// bitfield : bit14=E15, bit15=E16
public virtual long InfoFlags { get; set; } /// bitfield : bit14=E15, bit15=E16
public virtual bool Passed { get; set; }
public virtual int ResultCode { get; set; }
public virtual string Remark { get; set; }
public virtual string ArchivePath { get; set; }
public virtual string Remark { get; set; }
#if IPERL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual double Q2Correction { get; set; } /// !!! obsolete
public virtual int Q2CorrRFlow { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
public virtual int Q2CorrLFlow { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual int Q2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
public virtual int Q2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
public virtual double Diff2Hz8Hz { get; set; }
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual int Hz2Correction { get; set; } /// iPerl Q2 correction used during the test
public virtual string FWVersion { get; set; }
#endif
#if ORACLE_DB
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
#if TURA_SPECIAL
/// <summary>
/// Data from a production test bench (in case of tests on iPerl special)
/// </summary>
public virtual int AssignedSerialNr { get; set; }
public virtual string CompleteSerialNr { get; set; }
public virtual string RadioAddress { get; set; }
public virtual int PaletteNr { get; set; }
public virtual int UmkartonNr { get; set; }
public virtual string ProdTestBench { get; set; }
public virtual int ProdWMPosition { get; set; }
public virtual string ProdUserName { get; set; }
public virtual string ProdPurchaseOrder { get; set; }
public virtual bool ProdPassed { get; set; }
public virtual int ProdResultCode { get; set; }
public virtual int ProdQ2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
#endif
public virtual WaterMeterData WaterMeterData { get; set; }
#if ORACLE_DB
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
public virtual int HydrPruefung { get; set; }
public virtual int WMTypeRevision { get; set; } /// Not mapped to DB !!!
public virtual object RawTestInfos { get; set; } /// IList<SensusTestInfo> fetched from Oracle at the beginning of the cycle, not mapped to DB !!!
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
#endif
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session)
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual Batch Batch { get; set; }
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
@@ -54,6 +112,7 @@ namespace Results.Entities
public virtual string Producer() { return WaterMeterData.Producer; }
public virtual string MetrologicalClass() { return WaterMeterData.MetrologicalClass; }
public virtual string ApprovalInfo() { return WaterMeterData.ApprovalInfo; }
public virtual bool NewQnames() { return WaterMeterData.NewQnames; }
public virtual double Q4_Qmax() { return WaterMeterData.Q4_Qmax; }
public virtual double Q3_Qn() { return WaterMeterData.Q3_Qn; }
public virtual double Q2_Qt() { return WaterMeterData.Q2_Qt; }
@@ -78,9 +137,66 @@ namespace Results.Entities
public virtual MeterTestRslt LastMeterTestRslts() { return lastMeterTestRslts; }
public virtual long ErrorFlagsFromTests()
{
long errorFlags = 0;
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
}
return errorFlags;
}
public virtual long ErrorFlagsFromTestsAndWM()
{
return ErrorFlagsFromTests() | ErrorFlags;
}
/// <summary>
/// Convert combined errorFlags of all tests to string
/// </summary>
/// <returns>ErrorFlags string</returns>
public virtual string ErrorFlagsStr()
{
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM());
#if LANG_PL
return string.IsNullOrEmpty(eFlags) ? "brak" : eFlags;
#else
return eFlags;
#endif
}
public virtual string PassedOrErrorFlagsStr()
{
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM());
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr(null)) : eFlags;
}
/// <summary>
/// Convert failed tests and combined errorFlags of all tests to string
/// </summary>
/// <returns>ErrorFlagsEx string</returns>
public virtual string ErrorFlagsStrEx()
{
StringBuilder errFlgsStr = new StringBuilder();
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && mtr.TestDone && !mtr.Passed)
{
errFlgsStr.Append(mtr.Name());
errFlgsStr.Append(" ");
}
}
errFlgsStr.Append(Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM()));
return errFlgsStr.ToString();
}
public virtual bool PassedFromTests()
{
bool passed = true;
bool passed = (ErrorFlagsFromTestsAndWM() == 0);
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && (!mtr.Passed || !mtr.TestDone))
@@ -89,6 +205,7 @@ namespace Results.Entities
break;
}
}
return passed;
}
@@ -107,16 +224,22 @@ namespace Results.Entities
}
public virtual string PassedColorStr()
public virtual string PassedColorStr(string yesNoFormatOrEmpty)
{
#if PUCHONG_PT200
return Passed ? "OK|Green" : "NG|Red";
#else
return Passed ? "OK|Green" : "NOK|Red";
#endif
if (string.IsNullOrEmpty(yesNoFormatOrEmpty))
{
return Utils.PassedColorStr(Passed, true);
}
else
{
string[] yesNo = yesNoFormatOrEmpty.Split(new char[] { '~' });
return Passed ? yesNo[0] : ((yesNo.Length >= 2) ? yesNo[1] : Results.Resources.Strings.No);
}
}
///
/// Not mapped to the database
///
@@ -152,7 +275,12 @@ namespace Results.Entities
{
return mtr;
}
}
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound &&
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy)
{
return mtr;
}
}
}
return null;
}
@@ -164,6 +292,21 @@ namespace Results.Entities
return null;
}
public virtual bool TryGetTestRslt(string testName, out TestRslt testRslt)
{
MeterTestRslt mtr = GetMeterTestRslt(testName);
if (mtr != null)
{
testRslt = mtr.TestRslt;
return true;
}
else
{
testRslt = null;
return false;
}
}
public virtual TestData GetTestData(string testName)
{
foreach (var mtr in MeterTestRslts)
@@ -176,6 +319,21 @@ namespace Results.Entities
return null;
}
public virtual bool TryGetTestData(string testName, out TestData testData)
{
foreach (var mtr in MeterTestRslts)
{
if (mtr.TestRslt.TestData.Name == testName)
{
testData = mtr.TestRslt.TestData;
return true;
}
}
testData = null;
return false;
}
/// <summary>
@@ -184,6 +342,17 @@ namespace Results.Entities
public WaterMeter()
{
MeterTestRslts = new List<MeterTestRslt>();
#if ORACLE_DB
Pruefindex = 1;
HydrPruefung = 0;
WMTypeRevision = 0;
RawTestInfos = null;
CompleteTestInfos = null;
#endif
ProcessId = 0;
SessionId = 0;
ErrorFlags = 0;
LastRecordIsNok = false;
}
@@ -200,28 +369,51 @@ namespace Results.Entities
EndStateAux = src.EndStateAux;
QRise = src.QRise;
QFall = src.QFall;
ErrorFlags = src.ErrorFlags;
Passed = src.Passed;
ResultCode = src.ResultCode;
ArchivePath = src.ArchivePath;
Remark = src.Remark;
#if IPERL
SerialNrEx = src.SerialNrEx;
OrigCalibFactor = src.OrigCalibFactor;
CalibFactor = src.CalibFactor;
OrigCalibFactorLNA = src.OrigCalibFactorLNA;
CalibFactorLNA = src.CalibFactorLNA;
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
Q2CorrectionDone = src.Q2CorrectionDone;
Q2Correction = src.Q2Correction;
Q2CorrRFlow = src.Q2CorrRFlow;
Q2CorrLFlow = src.Q2CorrLFlow;
Q2CorrRL = src.Q2CorrRL;
Q2CorrLR = src.Q2CorrLR;
Q2CorrFlowRight = src.Q2CorrFlowRight;
Diff2Hz8Hz = src.Diff2Hz8Hz;
Hz2CorrectionDone = src.Hz2CorrectionDone;
Hz2Correction = src.Hz2Correction;
FWVersion = src.FWVersion;
#endif
#if ORACLE_DB
Pruefindex = src.Pruefindex;
HydrPruefung = src.HydrPruefung;
#if TURA_SPECIAL
AssignedSerialNr = src.AssignedSerialNr;
CompleteSerialNr = src.CompleteSerialNr;
RadioAddress = src.RadioAddress;
PaletteNr = src.PaletteNr;
UmkartonNr = src.UmkartonNr;
ProdTestBench = src.ProdTestBench;
ProdWMPosition = src.ProdWMPosition;
ProdUserName = src.ProdUserName;
ProdPurchaseOrder = src.ProdPurchaseOrder;
ProdPassed = src.ProdPassed;
ProdResultCode = src.ProdResultCode;
ProdQ2CorrRL = src.ProdQ2CorrRL;
ProdQ2CorrLR = src.ProdQ2CorrLR;
#endif
#if ORACLE_DB
Pruefindex = src.Pruefindex;
HydrPruefung = src.HydrPruefung;
WMTypeRevision = src.WMTypeRevision;
RawTestInfos = src.RawTestInfos;
CompleteTestInfos = src.CompleteTestInfos;
#endif
ProcessId = src.ProcessId;
SessionId = src.SessionId;
LastRecordIsNok = src.LastRecordIsNok;
foreach (var mtr in MeterTestRslts)
{
MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (Config.Entities.CompoundMeterId)mtr.CompoundMeterId);
@@ -237,7 +429,7 @@ namespace Results.Entities
{
StringBuilder sb = new StringBuilder(80);
#if IPERL
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrEx);
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrAux);
#else
sb.AppendFormat("S/N:{0} ", SerialNr);
#endif
@@ -246,5 +438,101 @@ namespace Results.Entities
sb.AppendFormat(" test start: {0} {1} batch={2}", StartTime().ToShortDateString(), StartTime().ToShortTimeString(), BatchNr());
return sb.ToString();
}
/// <summary>
/// Get decorated test names for a specified watermeter
/// </summary>
/// <param name="wMtr">Watermeter results entity</param>
/// <returns>A list of strings</returns>
public virtual IList<string> GetAllDecoratedTestNames()
{
IList<string> testNames = new List<string>();
if (MeterTestRslts != null)
{
foreach (var mtr in MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
&& mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
{
testNames.Add(mtr.Name());
}
}
}
return testNames;
}
static readonly System.Drawing.Color NotCompletedColor = System.Drawing.Color.White;
static readonly System.Drawing.Color OkColor = System.Drawing.Color.LightGreen;
static readonly System.Drawing.Color NokColor = System.Drawing.Color.LightPink;
static readonly System.Drawing.Color RejectColor = System.Drawing.Color.Magenta;
static readonly System.Drawing.Color ProductionErrorColor = System.Drawing.Color.RoyalBlue;
static readonly System.Drawing.Color WrongDirectionColor = System.Drawing.Color.Gold;
static readonly System.Drawing.Color WrongQ2FactorsColor = System.Drawing.Color.Red;
/// <summary>
/// Get color for highlighting results and an apporpriate text message.
/// </summary>
/// <param name="wMtr">Water meter results entity</param>
/// <param name="message">Appropriate message</param>
/// <returns>Color for results</returns>
public virtual System.Drawing.Color GetColorOfResults(bool maxRepeatsExceeded, out string message)
{
bool wmtrCompleted = CompletedFromTests();
bool wmtrPassed = PassedFromTests();
if ((ErrorFlags & (int)ErrorFlagMask.E28) != 0)
{
message = Strings.Previous_step_is_missing_or_NOK;
return ProductionErrorColor;
}
else if ((ErrorFlags & (int)ErrorFlagMask.E27) != 0)
{
message = Strings.Wrong_iPerl_counting_direction;
return WrongDirectionColor;
}
else if ((ErrorFlags & (int)ErrorFlagMask.E26) != 0)
{
message = Strings.Invalid_Q2_correction_factors;
return WrongQ2FactorsColor;
}
else if (wmtrPassed)
{
/// Water meter passed (therefore is was also completed)
message = Strings.Passed;
return OkColor;
}
else if (wmtrCompleted)
{
/// Water meter was completed but did not pass => Failed
if (maxRepeatsExceeded)
{
message = Strings.Test_repetition_count_exceeded_upper_limit;
return RejectColor;
}
else
{
message = Strings.Failed;
return NokColor;
}
}
else if (Disabled)
{
/// Water meter was not completed yet => did not pass, did not fail
message = Strings.This_position_is_disabled;
return NotCompletedColor;
}
else
{
/// Water meter was not completed yet => did not pass, did not fail
message = Strings.Test_in_progress;
return NotCompletedColor;
}
}
}
}
+8 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2017 Sensus Metering Systems
/// Copyright (c) 2015-2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -17,7 +17,8 @@ namespace Results.Entities
public virtual double DN { get; set; } /// [mm]
public virtual double L { get; set; } /// [mm]
public virtual Config.Entities.Mounting Mounting { get; set; } /// H / V / S / F
public virtual bool NewQnames { get; set; } /// Yes = Q3... No = Qn...
public virtual double Q4_Qmax { get; set; } /// [m3/h]
public virtual double Q3_Qn { get; set; } /// [m3/h]
public virtual double Q2_Qt { get; set; } /// [m3/h]
@@ -40,6 +41,8 @@ namespace Results.Entities
public virtual string MetrologicalClassAux { get; set; }
public virtual string ApprovalInfoAux { get; set; }
public virtual Config.Entities.Medium Medium { get; set; }
public virtual string Text1 { get; set; }
public virtual string Text2 { get; set; }
public virtual string Text3 { get; set; }
@@ -51,7 +54,6 @@ namespace Results.Entities
#if ORACLE_DB
public virtual int WMTypeId { get; set; }
public virtual int WMTypeRev { get; set; }
#endif
public WaterMeterData()
@@ -73,6 +75,7 @@ namespace Results.Entities
if (L != wmd.L) return false;
if (Mounting != wmd.Mounting) return false;
if (NewQnames != wmd.NewQnames) return false;
if (Q4_Qmax != wmd.Q4_Qmax) return false;
if (Q3_Qn != wmd.Q3_Qn) return false;
if (Q2_Qt != wmd.Q2_Qt) return false;
@@ -94,6 +97,8 @@ namespace Results.Entities
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
if (ApprovalInfoAux != wmd.ApprovalInfoAux) return false;
if (Medium != wmd.Medium) return false;
if (Text1 != wmd.Text1) return false;
if (Text2 != wmd.Text2) return false;
if (Text3 != wmd.Text3) return false;
@@ -105,7 +110,6 @@ namespace Results.Entities
#if ORACLE_DB
if (WMTypeId != wmd.WMTypeId) return false;
if (WMTypeRev != wmd.WMTypeRev) return false;
#endif
return true;
}
+202 -251
View File
@@ -1,14 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using Results.Resources;
using NHibernate;
using TracingDB.Entities;
namespace Results.Forms
{
@@ -16,42 +13,33 @@ namespace Results.Forms
{
static readonly ILog log = LogManager.GetLogger(typeof(BatchResultsDlg));
DateTime lastRedraw;
DateTime lastSizeChange;
bool loaded;
///
/// Public members
///
public Results.BatchResults Results;
public IList<Results.WMeterRsltItemSpec> Items;
public MetersArrangement MetersArrangement;
public TestsArrangement TestsArrangement;
public int NrMetersInOneGroup;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_SingleWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_CombinedWM;
public IList<Results.WMeterRsltItemSpec> RsltItems_Screen_HeatM;
public int[] RsltsClmnWidths { set { rsltsClmnWidths = value; } }
public bool ShowDisabledPositions;
public int MinWidth;
public int MinHeight;
public int PopupResultsLeft;
public int PopupResultsTop;
public int PopupResultsWidth;
public int PopupResultsHeight;
public int[] RsltsClmnWidths;
public Results.BatchResults Results { set { Display(value); } }
///
/// Private members
///
Results.BatchResults results;
MetersKind metersKind;
ListView firstListView;
public int[] rsltsClmnWidths;
int rsltsClmnCount { get { return (rsltsClmnWidths != null) ? rsltsClmnWidths.Length : 0; } }
int lvWidth;
int lvHeight;
IOneWMResultsCtrl[] wmRsltsCtrl; /// An array of controls with water meter results.
IOneWMResultsCtrl firstEnabledControl;
DateTime lastRedraw;
DateTime lastSizeChange;
int metersInOneGroup;
int nrGroups;
Timer timer;
@@ -59,292 +47,227 @@ namespace Results.Forms
public BatchResultsDlg()
{
InitializeComponent();
Text = Strings.Results;
firstEnabledControl = null;
lastSizeChange = DateTime.Now;
nrGroups = 1;
metersInOneGroup = 1;
// Create a timer with a ten second interval.
/// Create a timer with one second interval.
timer = new Timer();
timer.Interval = 500; /// ms
timer.Interval = 1000; /// ms
timer.Tick += new EventHandler(OnTimer);
timer.Start();
}
private void BatchResultsDlg_Load(object sender, EventArgs e)
{
if (PopupResultsLeft != 0) Left = PopupResultsLeft;
if (PopupResultsTop != 0) Top = PopupResultsTop;
if (PopupResultsWidth != 0) Width = PopupResultsWidth;
if (PopupResultsLeft != 0) Left = PopupResultsLeft;
if (PopupResultsTop != 0) Top = PopupResultsTop;
if (PopupResultsWidth != 0) Width = PopupResultsWidth;
if (PopupResultsHeight != 0) Height = PopupResultsHeight;
loaded = true;
if (results != null) Redraw();
}
public void Display(Results.BatchResults results)
{
this.results = results;
if (loaded) Redraw();
CreateControlsAndFillPanel(Results);
UpdateColumnWidths(RsltsClmnWidths);
UpdateResults(Results);
}
IList<Results.WMeterRsltItemSpec> GetRsltItems(MetersKind metersKind)
///
/// Handle double-click inside a water meter results control
///
void OnDoubleClick(object sender, Results.Forms.WaterMeterEventArgs args)
{
IList<Results.WMeterRsltItemSpec> srcItems;
switch (metersKind)
if (Results.WaterMeters != null && args.WMPosition > 0)
{
default:
case MetersKind.Single: srcItems = RsltItems_Screen_SingleWM; break;
case MetersKind.Combined: srcItems = RsltItems_Screen_CombinedWM; break;
case MetersKind.HeatMeter: srcItems = RsltItems_Screen_HeatM; break;
foreach (var wm in Results.WaterMeters)
{
if ((wm != null) && (wm.WMPosition == args.WMPosition))
{
ShowMoreWMResults(wm);
return;
}
}
}
IList<Results.WMeterRsltItemSpec> copiedItems = new List<Results.WMeterRsltItemSpec>();
foreach (var it in srcItems) copiedItems.Add(it.Clone());
return copiedItems;
MessageBox.Show(Strings.No_water_meter);
return;
}
void UpdateColumnWidths(int[] columnWidths)
{
foreach (var ctrl in wmRsltsCtrl) ctrl.Update(columnWidths);
}
void UpdateScrollpositions(int scrollStart)
{
/// TODO
}
/// <summary>
/// Re-draw the results. Apply new settings if they changed.
/// </summary>
public void Redraw()
void CreateControlsAndFillPanel(Results.BatchResults results)
{
lastRedraw = DateTime.Now;
this.SuspendLayout();
try
if ((results == null) || (results.WMPositionsCount == 0))
{
/// Determine how many water meters were enabled for result evaluation and printing
int enabledWMsCount = 0;
for (int i = 0; i < results.WMPositionsCount; i++)
{
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
{
enabledWMsCount++;
}
}
int metersInOneGroup = Math.Max(1, Math.Min(enabledWMsCount, NrMetersInOneGroup));
int nrGroups = Math.Max(1, (enabledWMsCount + metersInOneGroup - 1) / metersInOneGroup);
if (MetersArrangement == MetersArrangement.Horizontally)
{
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
lvWidth = flowLayoutPanel.Width / metersInOneGroup - 6;
lvHeight = flowLayoutPanel.Height / nrGroups - 6;
}
else
{
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
lvWidth = flowLayoutPanel.Width / nrGroups - 6;
lvHeight = flowLayoutPanel.Height / metersInOneGroup - 6;
}
/// There are no water meters at all
flowLayoutPanel.Controls.Clear();
flowLayoutPanel.WrapContents = true;
flowLayoutPanel.AutoScroll = true;
bool first = true;
for (int i = 0; i < results.WMPositionsCount; i++)
{
if (results.WaterMeters[i] != null && !results.WaterMeters[i].Disabled)
{
if (TestsArrangement == TestsArrangement.Rows)
{
ListView lview = GetResultsTestsAreRows(results.WaterMeters[i], i + 1);
if (first) { firstListView = lview; first = false; }
if (lview != null) flowLayoutPanel.Controls.Add(lview);
}
else
{
ListView lview = GetResultsTestsAreColumns(results.WaterMeters[i], i + 1);
if (first) { firstListView = lview; first = false; }
if (lview != null) flowLayoutPanel.Controls.Add(lview);
}
}
}
}
catch (Exception e)
{
log.FatalFormat("Redrawing results failed : {0}", e.Message);
if (e.InnerException != null)
{
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
}
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
wmRsltsCtrl = new OneWMResultsRowsCtrl[0];
firstEnabledControl = null;
return;
}
this.ResumeLayout(false);
}
/// <summary>
/// Get an empty ListView control with appropriate parameters.
/// </summary>
/// <returns>ListView control</returns>
ListView GetListView()
{
ListView lview = new ListView();
lview.AllowColumnReorder = false;
lview.Dock = System.Windows.Forms.DockStyle.None;
lview.FullRowSelect = true;
lview.GridLines = true;
lview.Location = new System.Drawing.Point(0, 0);
lview.Size = new System.Drawing.Size(lvWidth, lvHeight);
lview.TabIndex = 0;
lview.UseCompatibleStateImageBehavior = false;
lview.View = System.Windows.Forms.View.Details;
return lview;
}
/// <summary>
/// Get decorated test names for a specified watermeter
/// </summary>
/// <param name="wMtr">Watermeter results entity</param>
/// <returns>A list of strings</returns>
IList<string> GetAllDecoratedTestNames(Results.Entities.WaterMeter wMtr)
{
IList<string> testNames = new List<string>();
foreach (var mtr in wMtr.MeterTestRslts)
///
/// Determine water meter positions count
///
int displayedControlsCount = 0;
for (int i = 0; i < results.WaterMeters.Length; i++)
{
if (mtr.IsPilotRslt() && mtr.TestDone && (mtr.Publish() != Config.Entities.Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal))
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
{
testNames.Add(mtr.Name());
displayedControlsCount++;
}
}
return testNames;
}
///
/// Calculate geometry
///
metersInOneGroup = Math.Max(1, Math.Min(displayedControlsCount, NrMetersInOneGroup));
nrGroups = Math.Max(1, (displayedControlsCount + metersInOneGroup - 1) / metersInOneGroup);
/// <summary>
/// Get a ListView control filled with results of the meter 'mtr'
/// </summary>
/// <param name="mtr">Water meter number (1-based): 1 .. Config.Data.WMsCount</param>
/// <returns>ListView object</returns>
ListView GetResultsTestsAreRows(Results.Entities.WaterMeter wMtr, int printedWMNr)
{
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int col = 1;
foreach (var item in items)
int oneWidth;
int oneHeight;
///
if (MetersArrangement == MetersArrangement.Horizontally)
{
lview.Columns.Add(item.Caption, (rsltsClmnCount > col) ? rsltsClmnWidths[col] : 70);
col++;
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / metersInOneGroup - 6);
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / nrGroups - 6);
}
else
{
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / nrGroups - 6);
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / metersInOneGroup - 6);
}
///
/// Create controls and fill the FlowLayoutPanel
///
flowLayoutPanel.SuspendLayout();
flowLayoutPanel.Controls.Clear();
flowLayoutPanel.WrapContents = true;
flowLayoutPanel.AutoScroll = true;
IList<string> testNames = GetAllDecoratedTestNames(wMtr);
wmRsltsCtrl = new IOneWMResultsCtrl[displayedControlsCount];
int ix = 0;
foreach (var mtr in wMtr.MeterTestRslts)
firstEnabledControl = null;
for (int i = 0; i < results.WaterMeters.Length; i++)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never
&& mtr.Publish() != Config.Entities.Publish.Internal)
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
{
ListViewItem lvi = new ListViewItem(testNames[ix++]);
/// Create one water meter position / control
wmRsltsCtrl[ix] = (TestsArrangement == TestsArrangement.Rows)
? new OneWMResultsRowsCtrl() as IOneWMResultsCtrl
: new OneWMResultsColumnsCtrl() as IOneWMResultsCtrl;
wmRsltsCtrl[ix].Width = oneWidth;
wmRsltsCtrl[ix].Height = oneHeight;
for (int i = 0; i < items.Count; i++)
if ((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
{
string str = items[i].Print(wMtr, mtr.Name());
if ((firstEnabledControl == null) && (results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled)
{
firstEnabledControl = wmRsltsCtrl[ix];
}
/// Extract and use color information
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
//wmRsltsCtrl[ix].Update(results.WaterMeters[i].WMPosition);
wmRsltsCtrl[ix].Update(Items);
wmRsltsCtrl[ix].WMResultsClickedHandler += delegate(object s, Results.Forms.WaterMeterEventArgs args)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
if (InvokeRequired)
{
Invoke(new EventHandler<Results.Forms.WaterMeterEventArgs>(OnDoubleClick), s, args);
}
else
{
OnDoubleClick(s, args);
}
};
}
lview.Items.Add(lvi);
flowLayoutPanel.Controls.Add(wmRsltsCtrl[ix] as UserControl);
ix++;
}
}
return lview;
flowLayoutPanel.ResumeLayout();
lastRedraw = DateTime.Now;
}
/// <summary>
/// Get a ListView control filled with results of the meter 'mtr'
/// </summary>
/// <param name="mtr">Water meter number (1-based): 1 .. Config.Data.WMsCount</param>
/// <returns>ListView object</returns>
ListView GetResultsTestsAreColumns(Results.Entities.WaterMeter wMtr, int printedWMNr)
void UpdateResults(Results.BatchResults results)
{
metersKind = wMtr.Compound() ? MetersKind.Combined : (wMtr.HeatMeter() ? MetersKind.HeatMeter : MetersKind.Single);
ListView lview = GetListView();
IList<Results.WMeterRsltItemSpec> items = GetRsltItems(metersKind);
if (items == null || items.Count == 0) return lview;
// Header
lview.Columns.Add(printedWMNr.ToString(), (rsltsClmnCount > 0) ? rsltsClmnWidths[0] : 40);
int i = 1;
foreach (var str in GetAllDecoratedTestNames(wMtr))
if ((results != null) && (results.WaterMeters != null))
{
lview.Columns.Add(str, (rsltsClmnCount > i) ? rsltsClmnWidths[i] : 70);
i++;
}
foreach (var item in items)
{
ListViewItem lvi = new ListViewItem(item.Caption);
foreach (var mtr in wMtr.MeterTestRslts)
int ctrlIx = 0;
for (int i = 0; i < results.WaterMeters.Length; i++)
{
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never &&
mtr.Publish() != Config.Entities.Publish.Internal)
if (((results.WaterMeters[i] != null) && !results.WaterMeters[i].Disabled) || ShowDisabledPositions)
{
string str = items[i].Print(wMtr, mtr.Name());
string[] texts = str.Split(new char[] { '|' });
if (texts.Length == 1)
{
lvi.SubItems.Add(str);
}
else if (texts.Length == 2)
{
Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(texts[0]);
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = color;
}
else
{
lvi.SubItems.Add(string.Empty);
}
if (ctrlIx < wmRsltsCtrl.Length) wmRsltsCtrl[ctrlIx++].Update(results.WaterMeters[i]);
}
}
lview.Items.Add(lvi);
}
return lview;
}
void ShowMoreWMResults(Results.Entities.WaterMeter wm)
{
if ((TracingDB.DB.SessionFactory == null) || string.IsNullOrEmpty(wm.SerialNr))
{
new Results.Forms.MoreWMResultsDlg(wm, null).ShowDialog();
}
else
{
using (ISession session = TracingDB.DB.SessionFactory.OpenSession())
{
IList<ReferenceRecord> refRecords = session.QueryOver<ReferenceRecord>()
.Where(x => (x.Code == wm.SerialNr))
.OrderBy(x => x.TimeStamp).Desc
.List();
for (int i = 0; i < refRecords.Count; i++)
{
ReferenceRecord refR = refRecords[i];
if ((refR.Records != null) && (refR.Records.Count > 0))
{
/// Reference record has additional records/parts (i.e. it is PCB assembly workflow step)
///
foreach (var rec in refR.Records)
{
if (rec.Part.OraDBType.ToLower().Contains("flowtube"))
{
/// rec.Part is a flowtube
///
IList<ReferenceRecord> flowtubeRRs = session.QueryOver<ReferenceRecord>()
.Where(x => (x.Code == rec.Code))
.OrderBy(x => x.TimeStamp).Desc
.List();
foreach (var rr in flowtubeRRs) refRecords.Add(rr);
}
}
}
}
new Results.Forms.MoreWMResultsDlg(wm, refRecords).ShowDialog();
}
}
}
private void BatchResultsDlg_FormClosing(object sender, FormClosingEventArgs e)
{
PopupResultsLeft = Left;
@@ -353,6 +276,7 @@ namespace Results.Forms
PopupResultsHeight = Height;
}
private void flowLayoutPanel_SizeChanged(object sender, EventArgs e)
{
lastSizeChange = DateTime.Now;
@@ -362,13 +286,40 @@ namespace Results.Forms
{
if (DateTime.Compare(lastSizeChange, lastRedraw) > 0)
{
/// The last size change was later then the last redraw
/// The last size change was more recent then the last redraw
DateTime now = DateTime.Now;
if (DateTime.Compare(lastSizeChange + new TimeSpan(0, 0, 1), now) < 0)
{
/// More then 1s since the last size change
Redraw();
/// More then 1 second since the last panel size change
/// Calculate geometry
int oneWidth;
int oneHeight;
///
if (MetersArrangement == MetersArrangement.Horizontally)
{
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / metersInOneGroup - 6);
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / nrGroups - 6);
}
else
{
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
oneWidth = Math.Max(MinWidth, flowLayoutPanel.Width / nrGroups - 6);
oneHeight = Math.Max(MinHeight, flowLayoutPanel.Height / metersInOneGroup - 6);
}
/// Update size of controls
flowLayoutPanel.SuspendLayout();
///
foreach (var oneCtrl in wmRsltsCtrl)
{
oneCtrl.Width = oneWidth;
oneCtrl.Height = oneHeight;
}
///
flowLayoutPanel.ResumeLayout();
}
}
}
+25
View File
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Results.Forms
{
public interface IOneWMResultsCtrl
{
event EventHandler<WaterMeterEventArgs> WMResultsClickedHandler;
bool Disabled { get; } /// true when water meter position is disabled
int WMPosition { get; } /// 1-based WM position
int Width { get; set; } /// Control width
int Height { get; set; } /// Control height
ListView.ColumnHeaderCollection Columns { get; } /// Embedded ListView control columns
void Update(int[] columnWidths);
void Update(IList<Results.WMeterRsltItemSpec> items);
void Update(Results.Entities.WaterMeter wMtr);
}
}
+104
View File
@@ -0,0 +1,104 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Results.Forms
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ListViewExtensions
{
[StructLayout(LayoutKind.Sequential)]
public struct HDITEM
{
public Mask mask;
public int cxy;
[MarshalAs(UnmanagedType.LPTStr)]
public string pszText;
public IntPtr hbm;
public int cchTextMax;
public Format fmt;
public IntPtr lParam;
// _WIN32_IE >= 0x0300
public int iImage;
public int iOrder;
// _WIN32_IE >= 0x0500
public uint type;
public IntPtr pvFilter;
// _WIN32_WINNT >= 0x0600
public uint state;
[Flags]
public enum Mask
{
Format = 0x4, // HDI_FORMAT
};
[Flags]
public enum Format
{
SortDown = 0x200, // HDF_SORTDOWN
SortUp = 0x400, // HDF_SORTUP
};
};
public const int LVM_FIRST = 0x1000;
public const int LVM_GETHEADER = LVM_FIRST + 31;
public const int HDM_FIRST = 0x1200;
public const int HDM_GETITEM = HDM_FIRST + 11;
public const int HDM_SETITEM = HDM_FIRST + 12;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, SortOrder order)
{
IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)
{
var columnPtr = new IntPtr(columnNumber);
var item = new HDITEM
{
mask = HDITEM.Mask.Format
};
if (SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero)
{
throw new Win32Exception();
}
if (order != SortOrder.None && columnNumber == columnIndex)
{
switch (order)
{
case SortOrder.Ascending:
item.fmt &= ~HDITEM.Format.SortDown;
item.fmt |= HDITEM.Format.SortUp;
break;
case SortOrder.Descending:
item.fmt &= ~HDITEM.Format.SortUp;
item.fmt |= HDITEM.Format.SortDown;
break;
default:
break;
}
}
else
{
item.fmt &= ~HDITEM.Format.SortDown & ~HDITEM.Format.SortUp;
}
if (SendMessage(columnHeader, HDM_SETITEM, columnPtr, ref item) == IntPtr.Zero)
{
throw new Win32Exception();
}
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Windows.Forms;
namespace Results.Forms
{
public class LviIntColumnComparer : IComparer
{
int column;
SortOrder order;
public LviIntColumnComparer()
{
column = 0;
order = SortOrder.Ascending;
}
public LviIntColumnComparer(int column, SortOrder order)
{
this.column = column;
this.order = order;
}
public int Compare(object x, object y)
{
int valX = int.Parse(((ListViewItem)x).SubItems[column].Text);
int valY = int.Parse(((ListViewItem)y).SubItems[column].Text);
return (order == SortOrder.Descending) ? (valY - valX) : (valX - valY);
}
}
}

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