Compare commits

..
Author SHA1 Message Date
michal e57c6a6a02 Add ShowDialog and SaveCommunication fields to EntryFormCfg, implement related functionalities in PoseidonReader and EntryForm, and improve logging with ScopedLoggerFactory integration. 2025-09-17 10:45:40 +02:00
michal afa215534c Version increment to 3.9.2146.4 2025-09-09 20:48:19 +02:00
michal 780d44166e Refactor PoseidonReader to use lazy initialization for CliRunner, introduce SafetyTimeOut, enhance JSON deserialization with fallback logic, and improve error logging using log4net. 2025-09-09 20:47:53 +02:00
michal 35e4078dda Merge branch 'master-3' into PoseidonCmd 2025-09-09 15:13:29 +02:00
michal 47e09584f2 Frequency pulse meter 2025-09-09 12:51:26 +02:00
michal fc8e82c0e8 Merge branch 'master-3' into feature/processLogging
# Conflicts:
#	TBF/Rig/Sequences/ProcessData.cs
#	TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs
2025-09-09 12:24:20 +02:00
michal b729b08da2 Version increment to 3.9.2146.3 2025-09-08 14:34:04 +02:00
michal 3209ff303c Add support for optional IRegReader parameter in ShowCycleBeginFormOp across multiple DataEntry modules and enhance PoseidonReader with SerialNr handling and simulation mode adjustments 2025-09-08 14:32:49 +02:00
michal 41693d9c83 Update configuration for IPERL support and logging enhancements
This commit integrates the `IPERL` mode across multiple projects by updating the `DefineConstants` in project configurations. It also improves logging by adding a `LogCache` appender and modifying root logger settings in the `log4netConfig.xml` file.
2025-09-08 10:09:47 +02:00
michal 8f02f4ff31 Merge branch 'master-3' into PoseidonCmd
# Conflicts:
#	TBF/Properties/AssemblyInfo.cs
2025-09-07 22:36:46 +02:00
michal 1525bb7c1a Patch applied - Add initial implementation for IperlHeadTestCtrl and NfcServices
This commit introduces the `IperlHeadTestCtrl` component and `NfcServices` class, including core functionality for communication with iPerl heads via NFC/RFID. It integrates configuration options, multithreaded commands processing, and logging through `log4net`.
2025-09-07 22:34:06 +02:00
michal 2aeaf42325 Patch applied - Add initial implementation for RegValveLowRegulTimeSaturation module
This commit introduces the `RegValveLowRegulTimeSaturation` module, including core components such as `RegValve`, `ChangeRegValvePositionOp`, `Factory`, `Handlers`, and configuration classes (`RegValveCfg`, `RegValveCfgCtrl`). It integrates `log4net` for logging and adheres to the established modular design architecture.
2025-09-07 22:18:35 +02:00
michal bf4fb469da Add initial implementation for AppDiagnostic project
This commit introduces the AppDiagnostic project structure, including core components like `MainForm`, logging utilities (`LogAdapter`, `LogFilter`), and configuration files. It integrates with `log4net` for logging and uses `SharedComponents` for shared utilities.
2025-09-07 22:13:58 +02:00
michal efd0515295 Patch applied - Added new calibration-related properties for IPERL mode, integrated AppDiagnostic functionality into UI, and updated project configuration. 2025-09-07 17:42:26 +02:00
michal be8ac28bc7 Version increment to 3.9.2146.1 and update PoseidonReader to use VolumeLi instead of VolumeM3 2025-09-07 17:35:20 +02:00
michal 56dc89ac82 Version increment to 3.9.2146.0 2025-09-05 12:29:40 +02:00
michal 62ffc94c49 Add PoseidonCmd DataEntry module integration: EntryForm, EntryFormCfg, Factory, and TestStartEndForm 2025-09-05 12:23:06 +02:00
michal a20b0761fd Fix nested string formatting in DoubleBox's return statement
Revised the return statement to correctly handle nested string formatting by ensuring the format string is constructed properly. This resolves potential formatting issues with dynamic values.
2025-03-26 10:22:50 +01:00
michal 3b9e8d754d fix valve Debug Simulate mode 2025-01-10 08:48:52 +01:00
michal fed3281525 log for processData in LeakTestSeq.cs set 2025-01-08 07:43:58 +01:00
michal c1d966d86a final add process data to PMaxTestSeq.cs 2025-01-07 16:23:01 +01:00
michal b2d2f8c13b Solved problem with Null Exeprion in ProcessData.cs 2025-01-07 16:22:18 +01:00
michal 4e5e3d63e1 Fixed problem with F2 formating of decimal num 2025-01-07 16:21:28 +01:00
michal 25602fb914 Bug fix - Refactor flow meter handling and add validation checks.
Simplified flow meter logic by introducing a reusable variable for `LtrPerPulse` and handling potential null values. Added batch components correlation validation to ensure water meter counts align with configuration, preventing mismatches. Additionally, improved code formatting for consistency and readability.
2024-12-19 14:16:25 +01:00
michal 602d0d5308 Add logging for process start and measurement steps
Updated `PMaxTestSeq` to include logging of process data at key steps: process start and measurement. Added TODO comments to review logging positions for alignment with expected workflow.
2024-12-17 09:59:31 +01:00
michal f95198e40e revision update 2024-11-13 13:36:54 +01:00
michal d2b2bbb94b Merge branch 'refs/heads/feature/fix_Swindon' into master-3
# Conflicts:
#	TBF/Properties/AssemblyInfo.cs
2024-11-12 09:56:24 +01:00
michal a4246c7ea4 user groups based PL_LANG enabled, DB update needed 2024-11-12 09:52:41 +01:00
michal 498fc21412 DIVERTER close valve end time - Mark Chenges 2024-11-11 14:18:39 +01:00
michal 3f07a506ad Added new Nummer Result - Failed_meters_countE15 2024-11-06 14:58:39 +01:00
michal fb74e2d785 fix, NullPointerExeption If Order have no name 2024-11-04 15:41:09 +01:00
michal 3a2290570d Table merged columns with +,- in mixing mode returning -, old behaviour was last test evaluation 2024-10-30 15:17:24 +01:00
michal 3b68e3f9fd Version increment 2024-10-30 15:15:34 +01:00
michal 3184b1da8e LANG_PL enabled 2024-10-30 15:14:36 +01:00
michal b70a10e697 Merge branch 'master-3' into feature/outputPrinterFix 2024-10-30 06:55:55 +01:00
michal 3433bbbebe removed unnecessary, update of behaviour - textChanged 2024-10-29 09:26:04 +01:00
michal 4c0a797e98 improvement + changed behaviour 2024-10-28 22:45:50 +01:00
michal 203c2498ac temp commit - hepl method 2024-10-25 09:27:33 +02:00
michal 2023ea5221 simulate mode fix problem with Broadcast camera connection 2024-10-21 13:28:21 +02:00
michal cbb3d4f735 Merge branch 'master-3' into feature/KameraKeyenceAdvance 2024-10-11 10:46:32 +02:00
michal 8acf219ba2 packages - added what neccesary, also for JetBains IDE 2024-10-11 10:44:16 +02:00
michal 68884cd7df Merge branch 'master-3' into feature/FixProcessDataFile 2024-10-11 10:23:55 +02:00
michal 1629d82d65 save before update 2024/10/11 2024-10-11 10:00:36 +02:00
michal 17ab11bdf1 version increment 2024-10-11 09:59:43 +02:00
michal d2ef959f15 fix for Stop measurement and save/Collect after End Session 2024-10-09 16:07:11 +02:00
Jan Augustin 21b00e9b83 Oracle data access is only managed. No need to install the Oracle client on test bench anymore. 2024-10-09 10:40:11 +02:00
michal 3d7aaaaa3d Remove TBF.csproj.DotSettings file
This file was deleted because it is no longer needed in the project. It contained resource dictionary entries and paths that are now obsolete.
2024-10-07 10:54:44 +02:00
michal 705f7760af update by Michal requirements, manual setting dialog events changed, camera dialog both behaviour prepared, reload previous results copy image solved,rest API, rest API additional values added, added ShowTestCollectFormOp, added lang string 2024-10-07 10:54:04 +02:00
Jan Augustin 3b385d592d Updated .gitignore 2024-09-26 09:55:15 +02:00
michal cf6a16656b Remove outdated TODO comments 2024-09-04 14:06:06 +02:00
michal f50f9bfa5b Add KeyPress handlers to comboBoxes and buttons
This change introduces KeyPress event handlers to various UI elements such as comboBoxes and buttons to improve key input handling. The corresponding event handlers were implemented and the UI components were updated accordingly.
2024-09-04 14:02:21 +02:00
michal 77d8c95930 Purchase Order - Collector complete, bug fix in entities version 3.9.2149.11 2024-09-02 14:21:40 +02:00
michal 57c2019405 DB purchaseOrder -> Remove Config Entities - moved into Results 2024-09-02 08:30:34 +02:00
michal 46432bc61b Dialog events added 2024-08-30 12:42:29 +02:00
michal a4360f6993 All changes - collect cammera, fixed pictures preview, collecting pictures - 48 meters to grab data 2024-08-30 10:22:57 +02:00
michal 97e0a764b8 Enable -Simulate- for this method !!! 2024-08-14 12:06:45 +02:00
michal 7409af70ac Advance components - StandingStartMassCollectionAdvance 2024-08-14 11:59:26 +02:00
michal 783d51e71a Fix Diverter switching - in sequence, logs 2024-03-15 21:02:39 +01:00
michal a710ab7457 PL lang fix, camera test 2024-03-10 22:25:55 +01:00
michal 6a428e3c76 Keyence Camera 2024-03-10 22:24:03 +01:00
michal 2e56b8e5cf packages log4net.2.0.15 dependency 2024-02-17 20:28:17 +01:00
michal 1a4c18fa35 TBFTest - removed Compile Include test AdjustableMeterTest 2024-02-17 20:26:16 +01:00
michal 153d031125 log4net packages.config 2024-02-12 21:49:30 +01:00
michal 5d4c7dfe68 log4net ver 2.0.15 2024-02-12 21:44:42 +01:00
michal 021beeb47f GroupPrinter - print in separate files/printers 2024-02-12 21:41:25 +01:00
michal 1140d67c75 GroupPrinter 2024-02-04 10:07:50 +01:00
michal f0d26a36be reformating 2024-02-04 10:06:41 +01:00
michal 6afb10351e limit less linear correction 2024-02-04 10:00:22 +01:00
michal 2f3259d063 fix bug paths 2024-02-04 08:38:40 +01:00
michal 30a9396e4a verzia 3.9.2140 2024-01-24 17:51:37 +01:00
michal 2a94347f3e final modification for AdjustableMeter.cs, Added units A,V ElectricUnits, calculation based on [A] 2024-01-24 17:35:56 +01:00
michal 30f5e6c935 mesure Ampers in kPa = 0.01 koef, tranform into pressure linear interpolation 2024-01-07 22:54:47 +01:00
michal 0ad8bc6d75 new Adjustable Meter with value correction - two params 2023-12-28 23:47:56 +01:00
Milan Hanajik c076d6b343 Reconfigured for Katowice (CAMERA; LANG_PL) 2023-12-21 23:04:36 +01:00
Milan Hanajik 64e32751c0 ver. 3.9.2139 2023-12-21 23:04:10 +01:00
Milan Hanajik 279c8eefb4 DataEntry.Uni.CycleBgEnForm : autoSNButton --> multiPurposeButton, ver. 3.9.2137 2023-12-12 18:47:43 +01:00
Milan Hanajik b931ed62ff CombinedWithDetection : Extra test parameters 'UseAinsteadOfB' and 'DetectedFlowShift', ver. 3.9.2136 2023-12-08 21:21:42 +01:00
Milan Hanajik 05665288ab 1. LabelPrinting project created (based on Prod..Mon..SNPrinting), 2. Minor changes in Label.Printer 2023-12-07 17:41:10 +01:00
Milan Hanajik 8af89136e7 1. DataEntry.Uni.EntryFormCfg initialization : Order history, 2. Printers.Label clean-up, ver. 3.9.2135 2023-12-07 17:40:56 +01:00
Milan Hanajik 5b6461fa0a Czech language. 2023-12-02 22:09:02 +01:00
Milan Hanajik 1f51924bc8 1. Printer status, 2. Simulated printers, 3. Label.Printer uses wm.PrintLabel , etc. 2023-12-02 22:08:52 +01:00
Milan Hanajik b1f3b72a96 1. bool WaterMeter.PrintLabel, DataEntry.Uni: 2. "Auto s/n" function, 3. common check box, 4. Ct.PrintLabel (yes/no) 2023-12-02 21:59:34 +01:00
Milan Hanajik dfc0661300 ProcedureDlg supports 3 printers, ver. 3.9.2133 2023-12-02 21:51:02 +01:00
Milan Hanajik f747755301 Common.Forms.ModelessForm modifications. 2023-11-28 08:47:15 +01:00
Milan Hanajik ad2c1d615f ver. 3.9.2131 2023-11-28 08:45:10 +01:00
Milan Hanajik 11ad6d39ee Bug fix in Printers.Enhanced.PrinterCfgCtrl, ver. 3.9.2130 2023-11-28 08:44:12 +01:00
Milan Hanajik 0f394f622b Add(new WMeterRsltItemSpec(ItemID.Passed ... modification reverted, supports test results 2023-11-27 17:18:44 +01:00
Milan Hanajik 09c542e1e6 UpgradeSelectionDlg fixed : Rounding flows after converting them to double must be done at the very end, after all other upgrades. 2023-11-24 12:02:02 +01:00
Milan Hanajik d772a3d531 ver. 3.9.2129 2023-11-21 18:49:48 +01:00
Milan Hanajik 87206ebe79 page 1/1 not printed in OnePerBatch, OnePerMeter and Zapiska protocols, ver. 3.9.2128 2023-11-21 18:42:11 +01:00
Milan Hanajik f4c77feeef Diverter switch time is displayed in results for 'CombinedWithDetection' test method. 2023-11-21 18:17:18 +01:00
Milan Hanajik ae6d77efc1 PL language (Uzytkownici) 2023-11-09 17:44:11 +01:00
Milan Hanajik 8318ed33e1 OnePerMeter : Alignment 2023-11-09 17:44:00 +01:00
Milan Hanajik c4c86b36d2 TestData.IsFromToInPct and TestRslt.Qdetected added, TestRslt.Qfrom() / Qto() rewritten, CombinedWithDetectionSeq bug fix. 2023-11-09 11:59:24 +01:00
Milan Hanajik 990b695db6 Bridge.OnFlowDetected(...), Config.Entities.Component.Parameters mapped to VARCHAR(12000), ver. 3.9.2125 2023-11-09 11:59:11 +01:00
Milan Hanajik 33f050ef71 ProcedureDlg: bug fix when Qtg = detected, wider ComboBox-es, CombinedWithDetectionSeq bug fix, printer=profile name when creating, ver. 3.9.2123 2023-11-08 17:20:09 +01:00
Milan Hanajik 026a95e3ac Languages clean-up, MainWnd.pl.resx is not used anymore. 2023-11-07 17:31:43 +01:00
Milan Hanajik 4fd9030812 PTest.FlowId, ProfileType.CompoundQ3RQnClass... added, clean-up, DB 3.8 => 3.9, ver. 3.9.2118 2023-11-07 08:49:48 +01:00
Milan Hanajik 45d138ece3 Bug fixes in Results.Output.Table 2023-11-07 08:49:47 +01:00
Milan Hanajik 4a884a09a1 TestWizard improvements, ver. 3.8.2114 2023-10-30 15:36:41 +01:00
Milan Hanajik a524915f28 Metrology contains links to certificates saved as PDF files, CalibCertificateCtrl. 2023-10-17 17:31:35 +02:00
Milan Hanajik 7982526790 Bug fix in ValveBase, prevents PumpTandem in paths and transition sequences, ver. 3.8.2109 2023-10-12 21:22:55 +02:00
Milan Hanajik b866c45e9b CombinedWithDetection : DetectionKernelSize / DetectionBufferSize increased. 2023-10-12 15:23:26 +02:00
Milan Hanajik 0073ac8b9e Table rewritten, Cell, TopBorder, LeftBorder, BottomMerge, RightMerge added, merging OK, clean-up, ver. 3.8.2108 2023-10-12 15:23:06 +02:00
Milan Hanajik 36d661c75e 1. Results.ItemID.Passed gives always the meter result, 2. Results.WMeterRsltItemSpec.Merge added + UI changes 2023-10-12 15:23:05 +02:00
Milan Hanajik e3f1f2711b Start/stop valve switch time measurement implemented in StandingStart... test methods, ver. 3.8.2100 2023-09-22 13:52:50 +02:00
Milan Hanajik f9ae8c54e1 TestProfileDlg : compoundTabPage removed. 2023-09-22 10:05:25 +02:00
Milan Hanajik ad7abe5471 1. Profiles for Compound meters, 2. TestMethods.CombinedWithDetection modifications. 2023-09-22 10:01:01 +02:00
Milan Hanajik a027f3f544 test.Qform/Qto -> test.QfromM3ph()/QtoM3ph() in test methods, sequences, etc. 2023-09-22 10:01:01 +02:00
Milan Hanajik 0930df5e64 DB 3.7 --> 3.8, IsFromToInPct (unit for Qfrom/Qto) added to Entities.Test, IBenchInfo, ProcessData..., ver. 3.8.2097 2023-09-22 10:01:00 +02:00
Milan Hanajik 1c5bf76bb3 Changes for nanjing : iPerl.CycleBeginningForm and S640CommForm bug fixes. 2023-09-20 12:27:57 +02:00
Milan Hanajik d2d697ae80 ver. 3.7.2095 2023-08-25 09:52:41 +02:00
Milan Hanajik 60f30e4c41 Results, FlyingStartMassCollection and CombinedWithDetection : Main and Aux meter pulses, Div. switch time, ver. 3.7.2094 2023-08-24 13:12:30 +02:00
Milan Hanajik ecccfab7a6 FlyingStartMassCollection : Delayed start param., Action.IsDelayedStart added. 2023-08-23 14:59:42 +02:00
Milan Hanajik 1691c634c6 Diverter.Resolution 1, 2, 4, and 8 ms implemented, ver. 3.7.2092 2023-08-23 14:33:07 +02:00
Milan Hanajik 900a2d660c DataEntry.Uni : Compound meters support. 2023-08-18 12:21:02 +02:00
Milan Hanajik eaf60f3292 DB 3.6 -> 3.7, PulsesPerLtrAux added to WaterMeterData and to Results items, MainSeqUtils and ProcedureDlg changes, ver. 3.7.2088 2023-08-17 19:57:58 +02:00
Milan Hanajik bc0de96ad9 Compound profiles support in progress 2023-08-15 15:31:17 +02:00
Milan Hanajik a770f5a9b8 ver. 3.6.2087 2023-08-14 10:20:01 +02:00
1760 changed files with 724957 additions and 20404 deletions
+13
View File
@@ -26,6 +26,8 @@ GenericTest/bin/
GenericTest/obj/
GraphLib/bin/
GraphLib/obj/
LabelPrinting/bin/
LabelPrinting/obj/
MergeResultsDBs/bin/
MergeResultsDBs/obj/
OrderManagement/bin/
@@ -64,6 +66,17 @@ WorkflowConfigurator/bin/
WorkflowConfigurator/obj/
Workplace/bin/
Workplace/obj/
DataStreamInterfaceTest/bin/
DataStreamInterfaceTest/obj/
DataStreamMeter/bin/
DataStreamMeter/obj/
Events/bin/
Events/obj/
TracingDB/bin/
TracingDB/obj/
Users/bin/
Users/obj/
.vs/
.idea/
*.suo
*.bak
-1
View File
@@ -1 +0,0 @@
TBF
-22
View File
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="RD-241.19072.26">
<data-source name="@localhost" uuid="2f1012d5-a96b-44db-ad21-032f973c657f">
<database-info product="MySQL" version="5.5.39" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="5.5.39" exact-driver-version="8.2">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
<user-name>root</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema">
<name qname="@" />
<name qname="jor" />
<name qname="jor-r" />
</node>
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="@localhost" uuid="2f1012d5-a96b-44db-ad21-032f973c657f">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<configured-by-url>true</configured-by-url>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>
@@ -1,2 +0,0 @@
#n:information_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]
@@ -1,2 +0,0 @@
#n:jor-r
!<md> [0, 0, null, null, -2147483648, -2147483648]
@@ -1,2 +0,0 @@
#n:jor
!<md> [0, 0, null, null, -2147483648, -2147483648]
@@ -1,2 +0,0 @@
#n:mysql
!<md> [null, 0, null, null, -2147483648, -2147483648]
@@ -1,2 +0,0 @@
#n:performance_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="2" />
</component>
</project>
@@ -1,4 +0,0 @@
<changelist name="Add_combo_box_for_box_input" date="1723454080052" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Add_combo_box_for_box_input/shelved.patch" />
<option name="DESCRIPTION" value="Add combo box for box input" />
</changelist>
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
<changelist name="AdjustableMeterTest_cs_unit_Test" date="1708186855829" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/AdjustableMeterTest_cs_unit_Test/shelved.patch" />
<option name="DESCRIPTION" value="AdjustableMeterTest.cs unit Test" />
</changelist>
@@ -1,97 +0,0 @@
Index: TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs b/TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs
new file mode 100644
--- /dev/null (date 1706131720128)
+++ b/TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs (date 1706131720128)
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using Config.Entities;
+using JetBrains.Annotations;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using TBF.Rig.Modbus.Meret.AdjustableScale;
+
+namespace TBFTests.Rig.Modbus.Meret.AdjustableScale
+{
+ [TestClass]
+ [TestSubject(typeof(AdjustableMeter))]
+ public class AdjustableMeterTest
+ {
+
+ /**
+ * new typ of linear correction - limit less from Hi
+ */
+ [TestMethod]
+ public void GetCorrection()
+ {
+
+ double rawValue, expectedVal;
+ IList<MeasurementCorrection> corrections;
+
+ corrections = new List<MeasurementCorrection>(2);
+ MeasurementCorrection Lo, Hi;
+ Lo = new MeasurementCorrection(1);
+ Lo.Measurement = 0.00; //CorrectionValLo;
+ Lo.Correction = 0.0F; //MsrdValLimLo;
+ corrections.Add(Lo);
+ Hi = new MeasurementCorrection(2);
+ Hi.Measurement = 0.22F;//CorrectionValHi;
+ Hi.Correction = 2.0F;//MsrdValLimHi;
+ corrections.Add(Hi);
+
+
+ expectedVal = Lo.Correction;
+ rawValue = Lo.Measurement; //Ampers
+
+ double CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
+ Assert.IsTrue(expectedVal == CorrectionVal);
+
+ expectedVal = Hi.Correction;
+ rawValue = Hi.Measurement; //Ampers
+
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
+ Assert.IsTrue(expectedVal == CorrectionVal);
+
+ double toler = 0.01;
+ expectedVal = Hi.Correction * 2.0;
+ rawValue = Hi.Measurement * 2.0; //Ampers
+
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
+ Assert.IsTrue((expectedVal + toler) >= CorrectionVal && (expectedVal - toler) <= CorrectionVal);
+
+ corrections = new List<MeasurementCorrection>(2);
+ Lo = new MeasurementCorrection(1);
+ Lo.Measurement = 0.04; //CorrectionValLo;
+ Lo.Correction = 0.0F; //MsrdValLimLo;
+ corrections.Add(Lo);
+ Hi = new MeasurementCorrection(2);
+ Hi.Measurement = 0.22F;//CorrectionValHi;
+ Hi.Correction = 2.0F;//MsrdValLimHi;
+ corrections.Add(Hi);
+
+ toler = 0.3;
+ expectedVal = 1.24; //bar
+ rawValue = 0.152; //Ampers
+
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
+ Assert.IsTrue((expectedVal + toler) >= CorrectionVal && (expectedVal - toler) <= CorrectionVal);
+
+ toler = 0.0001;
+ expectedVal = 1.0;
+ rawValue = Lo.Measurement + ((Hi.Measurement - Lo.Measurement) / 2.0); //Ampers 0.129999999403954
+
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
+ Assert.IsTrue((expectedVal + toler) >= CorrectionVal && (expectedVal - toler) <= CorrectionVal);
+ }
+ }
+}
\ No newline at end of file
@@ -1,4 +0,0 @@
<changelist name="DB_test_-_purchase_order" date="1725258409183" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/DB_test_-_purchase_order/shelved.patch" />
<option name="DESCRIPTION" value="DB test - purchase order" />
</changelist>
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
<changelist name="Frequency_Meter_From_UniCB" date="1708416562473" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Frequency_Meter_From_UniCB/shelved.patch" />
<option name="DESCRIPTION" value="Frequency Meter From UniCB" />
</changelist>
@@ -1,687 +0,0 @@
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs
new file mode 100644
--- /dev/null (date 1708352606823)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs (date 1708352606823)
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using System.Xml.Serialization;
+using Common;
+using Config.Entities;
+using TBF.Rig.Generic;
+
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
+{
+ public class RRCfg : ComponentCfgBase, Generic.IChildComponentCfg
+ {
+
+ public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRCfg) })[0];
+ public override XmlSerializer GetSerializer() { return Serializer; }
+
+ IComponentCfgCtrl IComponentCfg.GetControl(IList<Component> cmpntEntities) { return new RRCfgCtrl(); }
+
+ ///
+ /// Serialized parameters
+ ///
+ public int Position; /// 1..nrWaterMeters
+
+ /// <summary> Procedure parameters </summary>
+ [XmlIgnore]
+ public RRProcParams ProcParams;
+ public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
+ public override IParamsProvider CreateProcParamsProvider() { return new RRProcParams(true); }
+
+ /// Private parameterless constructor invoked by all other (public) constructors
+ RRCfg()
+ {
+ ProcParams = new RRProcParams(true);
+ }
+
+ public RRCfg(string name, IComponentFactory factory)
+ : this()
+ {
+ Name = name;
+ Factory = factory;
+ ParentName = "UniCB";
+ Position = 1;
+ }
+
+ string IComponentCfg.ToString(int i)
+ {
+ return string.Format("Name={0}, Parent={1}, Position={2}",
+ Name,
+ (string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
+ Position);
+ }
+ }
+}
\ No newline at end of file
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs
new file mode 100644
--- /dev/null (date 1708352608817)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs (date 1708352608817)
@@ -0,0 +1,106 @@
+///
+/// Copyright (c) 2021 Sensus Slovensko a.s.
+///
+using System;
+using System.Windows.Forms;
+using Common;
+using TBF.Rig.Generic;
+using TBF.UI.Bench.Components;
+
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
+{
+ public partial class RRCfgCtrl : UserControl, IComponentCfgCtrl
+ {
+ ComponentParametersDlg parent;
+
+ bool IComponentCfgCtrl.ShowMore { get { return false; } }
+
+ RRCfg config;
+
+ IComponentCfg IComponentCfgCtrl.Config
+ {
+ get { return config as IComponentCfg; }
+ set
+ {
+ config = value as RRCfg;
+ Redraw();
+ }
+ }
+
+ public RRCfgCtrl()
+ {
+ InitializeComponent();
+ }
+
+ private void RegisterReaderCfgCtrl_Load(object sender, EventArgs e)
+ {
+ parent = ParentForm as ComponentParametersDlg;
+ if (parent == null) return;
+
+ if (parent.CmpntEntities != null)
+ {
+ foreach (var cmpnt in parent.CmpntEntities)
+ {
+ if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is ControlBoard.Uni.Factory)
+ {
+ parentNameComboBox.Items.Add(cmpnt.Name);
+ }
+ }
+ }
+
+ Redraw();
+ }
+
+ void IComponentCfgCtrl.Closing()
+ {
+ }
+
+ void Redraw()
+ {
+ if (config == null) return; /// Control was not loaded, settings were not changed
+
+ componentNameLabel.Text = config.Factory.ClassName;
+ nameTextBox.Text = config.Name;
+ parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
+ positionTextBox.Text = config.Position.ToString();
+ }
+
+ void IComponentCfgCtrl.Unlock()
+ {
+ nameTextBox.Enabled = true;
+ parentNameComboBox.Enabled = true;
+ positionTextBox.Enabled = true;
+ }
+
+ CfgUpdateFlags IComponentCfgCtrl.VerifyCfg(ref string message)
+ {
+ CfgUpdateFlags flags = CfgUpdateFlags.None;
+
+ int dummy;
+ if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
+ {
+ flags |= CfgUpdateFlags.Error;
+ message += Environment.NewLine + "Invalid 'Parent Name'";
+ }
+ if (!int.TryParse(positionTextBox.Text, out dummy) || (dummy < 1))
+ {
+ flags |= CfgUpdateFlags.Error;
+ message += Environment.NewLine + "'Position' should be >= 1";
+ }
+ return flags;
+ }
+
+ CfgUpdateFlags IComponentCfgCtrl.UpdateCfg()
+ {
+ CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
+
+ if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
+
+ config.Name = nameTextBox.Text;
+ config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
+ config.Position = int.Parse(positionTextBox.Text);
+
+ return flags;
+ }
+ }
+}
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs
new file mode 100644
--- /dev/null (date 1708348624609)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs (date 1708348624609)
@@ -0,0 +1,133 @@
+///
+/// Copyright (c) 2021 Sensus Slovensko a.s.
+///
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
+{
+ partial class RRCfgCtrl
+ {
+ /// <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.positionTextBox = new System.Windows.Forms.TextBox();
+ this.positionLabel = new System.Windows.Forms.Label();
+ this.parentNameLabel = new System.Windows.Forms.Label();
+ this.nameTextBox = new System.Windows.Forms.TextBox();
+ this.nameLabel = new System.Windows.Forms.Label();
+ this.componentNameLabel = new System.Windows.Forms.Label();
+ this.parentNameComboBox = new System.Windows.Forms.ComboBox();
+ this.SuspendLayout();
+ //
+ // positionTextBox
+ //
+ this.positionTextBox.Enabled = false;
+ this.positionTextBox.Location = new System.Drawing.Point(136, 119);
+ this.positionTextBox.Name = "positionTextBox";
+ this.positionTextBox.Size = new System.Drawing.Size(46, 20);
+ this.positionTextBox.TabIndex = 6;
+ //
+ // positionLabel
+ //
+ this.positionLabel.AutoSize = true;
+ this.positionLabel.Location = new System.Drawing.Point(26, 122);
+ this.positionLabel.Name = "positionLabel";
+ this.positionLabel.Size = new System.Drawing.Size(44, 13);
+ this.positionLabel.TabIndex = 5;
+ this.positionLabel.Text = "Position";
+ //
+ // parentNameLabel
+ //
+ this.parentNameLabel.AutoSize = true;
+ this.parentNameLabel.Location = new System.Drawing.Point(26, 96);
+ this.parentNameLabel.Name = "parentNameLabel";
+ this.parentNameLabel.Size = new System.Drawing.Size(69, 13);
+ this.parentNameLabel.TabIndex = 3;
+ this.parentNameLabel.Text = "Parent Name";
+ //
+ // nameTextBox
+ //
+ this.nameTextBox.Enabled = false;
+ this.nameTextBox.Location = new System.Drawing.Point(136, 67);
+ this.nameTextBox.Name = "nameTextBox";
+ this.nameTextBox.Size = new System.Drawing.Size(130, 20);
+ this.nameTextBox.TabIndex = 2;
+ //
+ // nameLabel
+ //
+ this.nameLabel.AutoSize = true;
+ this.nameLabel.Location = new System.Drawing.Point(26, 70);
+ this.nameLabel.Name = "nameLabel";
+ this.nameLabel.Size = new System.Drawing.Size(35, 13);
+ this.nameLabel.TabIndex = 1;
+ this.nameLabel.Text = "Name";
+ //
+ // componentNameLabel
+ //
+ this.componentNameLabel.AutoSize = true;
+ this.componentNameLabel.Location = new System.Drawing.Point(133, 43);
+ this.componentNameLabel.Name = "componentNameLabel";
+ this.componentNameLabel.Size = new System.Drawing.Size(83, 13);
+ this.componentNameLabel.TabIndex = 0;
+ this.componentNameLabel.Text = "ComonentName";
+ //
+ // parentNameComboBox
+ //
+ this.parentNameComboBox.Enabled = false;
+ this.parentNameComboBox.FormattingEnabled = true;
+ this.parentNameComboBox.Location = new System.Drawing.Point(136, 93);
+ this.parentNameComboBox.Name = "parentNameComboBox";
+ this.parentNameComboBox.Size = new System.Drawing.Size(130, 21);
+ this.parentNameComboBox.TabIndex = 4;
+ //
+ // RegisterReaderCfgCtrl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.parentNameComboBox);
+ this.Controls.Add(this.positionTextBox);
+ this.Controls.Add(this.positionLabel);
+ this.Controls.Add(this.parentNameLabel);
+ this.Controls.Add(this.nameTextBox);
+ this.Controls.Add(this.nameLabel);
+ this.Controls.Add(this.componentNameLabel);
+ this.Name = "RegisterReaderCfgCtrl";
+ this.Size = new System.Drawing.Size(300, 200);
+ this.Load += new System.EventHandler(this.RegisterReaderCfgCtrl_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox positionTextBox;
+ private System.Windows.Forms.Label positionLabel;
+ private System.Windows.Forms.Label parentNameLabel;
+ private System.Windows.Forms.TextBox nameTextBox;
+ private System.Windows.Forms.Label nameLabel;
+ private System.Windows.Forms.Label componentNameLabel;
+ private System.Windows.Forms.ComboBox parentNameComboBox;
+ }
+}
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx
new file mode 100644
--- /dev/null (date 1703243321441)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx (date 1703243321441)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs
new file mode 100644
--- /dev/null (date 1708352610233)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs (date 1708352610233)
@@ -0,0 +1,132 @@
+///
+/// Copyright (c) 2021 Sensus Slovensko a.s.
+///
+using System;
+using System.IO;
+using System.Text;
+using System.Xml.Serialization;
+using Common;
+using Config.Entities;
+using TBF.Rig.Generic;
+using TBF.Resources;
+
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
+{
+ public class RRProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
+ {
+ public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcParams) })[0];
+ public override XmlSerializer GetSerializer() { return Serializer; }
+
+ public double PulsesPerLtr; /// [l^-1]
+ public int Filter;
+
+ public override void InitializeAll()
+ {
+ PulsesPerLtr = 1.0;
+ Filter = 0;
+ }
+
+ string[] paramNames = new string[]
+ {
+ Strings.PulsesPerLtr,
+ Strings.Filter,
+ };
+ public override string ParamName(int i) { return paramNames[i]; }
+ public override int ParamsCount() { return paramNames.Length; }
+
+ public override string ToString(int i)
+ {
+ switch (i)
+ {
+ case 0: return PulsesPerLtr.ToString();
+ case 1: return Filter.ToString();
+ default: return string.Empty;
+ }
+ }
+
+ /// Retrieves parameters from UI controls
+ CfgUpdateFlags IParamsProvider.UpdateParam(int i, string strValue)
+ {
+ switch (i)
+ {
+ case 0: PulsesPerLtr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.None;
+ case 1: Filter = int.Parse(strValue); return CfgUpdateFlags.None;
+ default: return CfgUpdateFlags.None;
+ }
+ }
+
+ /// Verifies whether strings in UI controls represent valid parameters
+ bool IParamsProvider.ValidateParam(int i, string strValue, out string message)
+ {
+ message = string.Empty;
+
+ double dummy;
+ int idummy;
+ switch (i)
+ {
+ case 0:
+ if (Utils.TryParseUDouble(strValue, out dummy)) return true;
+ break;
+
+ case 1:
+ if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
+ break;
+
+ default:
+ message = "Invalid index";
+ return false;
+ }
+
+ message = ParamName(i) + " is invalid";
+ return false;
+ }
+
+ void CopyContentTo(RRProcParams prms)
+ {
+ prms.PulsesPerLtr = this.PulsesPerLtr;
+ prms.Filter = this.Filter;
+ }
+
+ IParamsProvider IParamsProvider.Clone()
+ {
+ RRProcParams pars = new RRProcParams();
+ CopyContentTo(pars);
+ return pars;
+ }
+
+ public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
+ {
+ if (dbEntity == null) return;
+ try
+ {
+ RRProcParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as RRProcParams;
+
+ procedureParamsEntity = dbEntity;
+ componentName = dbEntity.CmpntName;
+ procedure = dbEntity.Procedure;
+
+ if (tmp != null) tmp.CopyContentTo(this);
+ }
+ catch
+ {
+ }
+ }
+
+
+ public RRProcParams()
+ {
+ }
+
+ public RRProcParams(bool initialize)
+ {
+ if (initialize) InitializeAll();
+ }
+
+ public RRProcParams(ComponentProcedure procedureParamsEntity, string componentName, Procedure procedure)
+ {
+ this.procedureParamsEntity = procedureParamsEntity;
+ this.componentName = componentName;
+ this.procedure = procedure;
+ }
+ }
+}
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs
new file mode 100644
--- /dev/null (date 1708352610236)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs (date 1708352610236)
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using Config.Entities;
+using TBF.Rig.Generic;
+
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
+{
+ public class Factory : IComponentFactory
+ {
+ string IComponentFactory.ClassName { get { return GetType().Namespace.Substring(8); } }
+
+ public override string ToString() { return ClassName; }
+
+ IComponent IComponentFactory.DummyComponent() { return new FrequencyRegisterReader(); }
+
+ IComponent IComponentFactory.GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new FrequencyRegisterReader(cfg, components); }
+
+ IComponentCfg IComponentFactory.DefaultConfig() { return new RRCfg("Puls", this); }
+
+ IComponentCfg IComponentFactory.CmpntCfgFromCmpntEntity(Component component)
+ {
+ throw new System.NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs
new file mode 100644
--- /dev/null (date 1708352608953)
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs (date 1708352608953)
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using Common;
+using log4net;
+using TBF.Rig.GenericDevices;
+
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
+{
+ public class FrequencyRegisterReader : ComponentBase, GenericDevices.IRegReader
+ {
+ private static readonly ILog log = LogManager.GetLogger(typeof(FrequencyRegisterReader));
+
+ public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
+
+ readonly RRCfg rrCfg;
+ readonly TBF.Rig.ControlBoard.IControlBoard cb;
+
+ int IRegReader.Position { get{ return rrCfg.Position; } }
+ Common.RegisterReaderType IRegReader.RegisterReaderType { get { return Common.RegisterReaderType.Pulses; } }
+ double IRegReader.PulsesPerLtr { get { return rrCfg.ProcParams.PulsesPerLtr; } }
+ double IRegReader.LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); ; } }
+ public int Filter { get { return rrCfg.ProcParams.Filter; } }
+
+ int IRegReader.WMPulses { get { return cb.PulsesWM(Position); } }
+ int IRegReader.WMRefPulses { get { return cb.RefPulsesWM(Position); } }
+ double IRegReader.WMVolume { get { return LtrsPerPulse * Convert.ToDouble(WMPulses); } }
+
+ double IRegReader.BeginWMState { get { return 0; } } /// Always 0
+ double IRegReader.EndWMState { get { return WMVolume; } } /// Derived from WMVolume
+
+
+ public FrequencyRegisterReader() { }
+
+ public FrequencyRegisterReader(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
+ : base(cfg)
+ {
+ rrCfg = cfg as RRCfg;
+
+ cb = TbfComponents.FindComponent(cfg.ParentName, components) as TBF.Rig.ControlBoard.IControlBoard;
+ if (cb == null) throw new Exception("Cannot find " + Name + " parent");
+
+ log.Warn(this.ToString());
+ }
+
+ public override void Initialize() { }
+ }
+}
\ No newline at end of file
-4
View File
@@ -1,4 +0,0 @@
<changelist name="NEXT_5_24_2024" date="1716547261313" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/NEXT_5_24_2024/shelved.patch" />
<option name="DESCRIPTION" value="NEXT_5/24/2024" />
</changelist>
File diff suppressed because one or more lines are too long
-4
View File
@@ -1,4 +0,0 @@
<changelist name="Pressure_meter_test" date="1704310942302" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Pressure_meter_test/shelved.patch" />
<option name="DESCRIPTION" value="Pressure meter test" />
</changelist>
@@ -1,156 +0,0 @@
Index: TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs
===================================================================
diff --git a/TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs b/TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs
deleted file mode 100644
--- a/TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs (revision 0ad8bc6d759d868e021fc7087d3db5ba55f6a354)
+++ /dev/null (revision 0ad8bc6d759d868e021fc7087d3db5ba55f6a354)
@@ -1,148 +0,0 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using TBF.Rig.Modbus.PressureMeter.AdjustableScale;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using TBF.Rig.Generic;
-using Moq;
-
-
-
-
-namespace TBF.Rig.Modbus.PressureMeter.AdjustableScale.Tests
-{
- [TestClass()]
- public class PressureMeterTests
- {
-
-
-
- [TestMethod()]
- public void ToStringTest()
- {
- Factory factory = new Factory();
- IList<Generic.IComponent> list = new List<Generic.IComponent>();
- list.Add(factory.DummyComponent());
- PressureMeter meter = new PressureMeter(factory.DefaultConfig(), list);
-
- string str = meter.ToString();
- Assert.IsTrue(str == "Modbus.PressureMeter.AdjustableScale(Pr(Modbus) address=49)");
-
- }
-
- /* [TestMethod()]
- public void PressureMeterTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void PressureMeterTest1()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void InitializeTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void RunDeviceBeforeTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void RunDeviceAfterTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void StopDeviceTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void StopDevice2Test()
- {
- Assert.Fail();
- }*/
-
- class PressureMeterSpy : PressureMeter
- {
- public PressureMeterSpy(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
- :base(cfg, components)
- {
-
- }
-
- public new void InitModbus()
- {
- Console.Write("I am here!");
- }
-
- }
-
- [TestMethod()]
- public void ReadPressureTest()
- {
- Factory factory = new Factory();
- IList<Generic.IComponent> list = new List<Generic.IComponent>();
- list.Add(factory.DummyComponent());
-
-
-
- IComponentCfg componentCfg = factory.DefaultConfig();
- PressureMeterCfg pressureMeterCfg = (PressureMeterCfg) componentCfg;
-
- pressureMeterCfg.CorrectionValLo = 0.4;
- pressureMeterCfg.CorrectionValHi = 2.4;
- pressureMeterCfg.MsrdValLimHi = 2.0;
- pressureMeterCfg.MsrdValLimLo = 0.0;
-
- PressureMeterSpy meter = new PressureMeterSpy(componentCfg, list);
-
-
-
- meter.Initialize();
-
- double MeasuredVal = meter.MeasuredVal;
-
-
- double value = meter.ReadPressure();
- Assert.IsTrue(value == 0.0);
-
- }
-
- /*
- [TestMethod()]
- public void ReadPressureOpTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void ReadPressureOpTest1()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void ConditionNameTest()
- {
- Assert.Fail();
- }
-
- [TestMethod()]
- public void ConditionOpTest()
- {
- Assert.Fail();
- }*/
- }
-}
\ No newline at end of file
@@ -1,4 +0,0 @@
<changelist name="TBF_project_configuration_backup" date="1708187009519" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/TBF_project_configuration_backup/shelved.patch" />
<option name="DESCRIPTION" value="TBF project configuration backup" />
</changelist>
@@ -1,55 +0,0 @@
Index: TBF/app.config
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+><?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<configuration>\r\n <configSections>\r\n <section name=\"oracle.manageddataaccess.client\"\r\n type=\"OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342\"/>\r\n </configSections>\r\n <startup>\r\n <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.7.2\"/>\r\n </startup>\r\n <system.data>\r\n <DbProviderFactories>\r\n <remove invariant=\"Oracle.ManagedDataAccess.Client\"/>\r\n <add name=\"ODP.NET, Managed Driver\" invariant=\"Oracle.ManagedDataAccess.Client\" description=\"Oracle Data Provider for .NET, Managed Driver\"\r\n type=\"Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342\"/>\r\n </DbProviderFactories>\r\n </system.data>\r\n <runtime>\r\n <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n <dependentAssembly>\r\n <publisherPolicy apply=\"no\"/>\r\n <assemblyIdentity name=\"Oracle.ManagedDataAccess\" publicKeyToken=\"89b483f429c47342\" culture=\"neutral\"/>\r\n <bindingRedirect oldVersion=\"4.121.0.0 - 4.65535.65535.65535\" newVersion=\"4.122.19.1\"/>\r\n </dependentAssembly>\r\n </assemblyBinding>\r\n </runtime>\r\n <oracle.manageddataaccess.client>\r\n <version number=\"*\">\r\n <dataSources>\r\n <dataSource alias=\"SampleDataSource\" descriptor=\"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) \"/>\r\n </dataSources>\r\n </version>\r\n </oracle.manageddataaccess.client>\r\n</configuration>\r\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/TBF/app.config b/TBF/app.config
--- a/TBF/app.config (revision 153d031125d1637c9f23cea9e25ecff9c68bae9b)
+++ b/TBF/app.config (date 1707773182036)
@@ -1,32 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
- <section name="oracle.manageddataaccess.client"
- type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+ <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
<startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<system.data>
<DbProviderFactories>
- <remove invariant="Oracle.ManagedDataAccess.Client"/>
- <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
- type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+ <remove invariant="Oracle.ManagedDataAccess.Client" />
+ <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
- <publisherPolicy apply="no"/>
- <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
- <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/>
+ <publisherPolicy apply="no" />
+ <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
+ <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
- <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/>
+ <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources>
</version>
</oracle.manageddataaccess.client>
@@ -1,4 +0,0 @@
<changelist name="TBF_project_configuration_backup1" date="1708187045753" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/TBF_project_configuration_backup1/shelved.patch" />
<option name="DESCRIPTION" value="TBF project configuration backup" />
</changelist>
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
<changelist name="TestPDFSharpToUseGraphics" date="1708186637637" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/TestPDFSharpToUseGraphics/shelved.patch" />
<option name="DESCRIPTION" value="TestPDFSharpToUseGraphics" />
</changelist>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
<changelist name="Test_set_all_open,_closed_valves" date="1710251068900" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Test_set_all_open,_closed_valves/shelved.patch" />
<option name="DESCRIPTION" value="Test set all open, closed valves" />
</changelist>
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
<changelist name="Uncommitted_changes_before_Checkout_at_10_11_2024_10_19_AM_[Changes]" date="1728634772275" recycled="false" toDelete="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Uncommitted_changes_before_Checkout_at_10_11_2024_10_19_AM_[Changes]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 10/11/2024 10:19 AM [Changes]" />
</changelist>
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
<changelist name="Uncommitted_changes_before_Checkout_at_10_11_2024_10_36_AM_[Changes]" date="1728635764918" recycled="false" toDelete="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Uncommitted_changes_before_Checkout_at_10_11_2024_10_36_AM_[Changes]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 10/11/2024 10:36 AM [Changes]" />
</changelist>

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