Compare commits

..
Author SHA1 Message Date
michal ae787622d2 feat(build): add picture loading, validation, and error handling; introduce CopyReleasePictures.ps1 for release asset management 2026-10-06 10:00:31 +02:00
michal d248630ddc fix(build): exclude NLog.dll and NLog.xml from common package files; add validation for NLog runtime version in TBF output 2026-10-05 16:54:33 +02:00
michal b15d0a0a08 feat<fix>: add RegisterReaderGroupScheduler and ManualCommunicationGuard to TBF project files 2026-10-05 16:52:56 +02:00
michal 683ca25aaf feat<improvement>: improve COM port lifecycle handling and manual communication guard implementation across ASIC and ALLY readers 2026-10-05 16:52:25 +02:00
michal d3cc50b6e8 <fix> Add NLog binding redirect to App.config for version consistency 2026-10-05 16:49:10 +02:00
michal 8c3c866eff <FIX> GCI: remove unused NLog.Fluent reference from InterfaceGCIToLaatzen.cs 2026-10-05 16:48:30 +02:00
michal 78907de455 Merge updated TBF into ALLY_update while preserving ASIC/ALLY workflows 2026-10-05 10:58:44 +02:00
michal 500adfa789 Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode_ALLY' into develop/SLM-PT50_genesisDirectDecode_ALLY 2026-10-05 10:01:06 +02:00
michal 9658fc28bd feat(ally): introduce "additional common parameters" support with comprehensive tests, diagnostics, and enhanced logging 2026-10-05 10:00:54 +02:00
michal 42ad98ab1f feat(ally): introduce "additional common parameters" support with comprehensive tests, diagnostics, and enhanced logging 2026-10-05 10:00:30 +02:00
michal bd0a876b5b <Fix> Merge : Remove unused resource strings and replace project references with DLL references for CordonelPreadjustmentUi. 2026-10-05 09:57:00 +02:00
marekf 806cf0d670 <Merge-fix>: Merge develop/Local-master into develop/SLM-PT50_genesisDirectDecode_mirror, increase revision to 3.9.3147.112
Cause:

- develop/SLM-PT50_genesisDirectDecode_mirror lacked the latest changes from develop/Local-master.
- The target branch needed the updated results workflow, configuration persistence, diagnostics and packaged dependencies.

Solution:

1. Merge source branch into target branch
   - Merged develop/Local-master into develop/SLM-PT50_genesisDirectDecode_mirror.
   - Integrate the source branch changes into the target branch while retaining both parent histories.

2. Integrate application and dependency updates
   - Include the ResultsWorkspace and per-meter ResultsWriter export updates, persistent Previous results component settings and ASIC optical logging improvements.
   - Include tracked packages/Common files and runtime library updates.
   - Preserve the existing merge contents; this amendment changes only the commit message and application revision.

3. Regression verification
   - Verified the source and target branch names against the merge commit and its parent history.
   - Verified that AssemblyVersion and AssemblyFileVersion both use 3.9.3147.112 and that the revision diff passes whitespace checks.
   - No regression tests were added or run for this amendment; application build and merged runtime behavior remain unverified.

4. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.111 to 3.9.3147.112.
2026-10-02 11:50:57 +02:00
marekf 82a51293b9 <Update>: Track Common package dependencies and refresh runtime libraries, increase revision to 3.9.3147.111
Cause:

- The /packages ignore rule excluded new files under packages/Common.
- Required local dependencies and supporting files were missing from version control, making them unavailable in fresh checkouts.

Solution:

1. Track Common package files
   - Replace /packages with /packages/* and add an exception for /packages/Common/.
   - Add existing Common binaries, symbols, configuration, documentation and source files to version control.

2. Refresh runtime libraries
   - Include the staged ERegister data package and MagFlux/eRegister streaming protocol DLL and PDB updates.
   - Preserve ignoring of other package directories.

3. Regression verification
   - Verified that packages/Common allows new files while other package directories remain ignored.
   - Verified that no non-ignored Common files remain untracked.
   - No automated regression tests were added; application build and runtime tests were not run.
   - Whitespace checks reported existing trailing whitespace in imported package files; those files were preserved as supplied.

4. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.110 to 3.9.3147.111.
2026-10-02 11:44:02 +02:00
michal 4cd7867e04 <FIX> otho standing/flying ASIC/ALLY, Com ports loks
`chore: remove IperlHead.cs as part of codebase cleanup`
2026-10-02 11:43:28 +02:00
michal 6560278568 feat(ally): add C1 measurement validation, default scaling, and enhanced error handling with extended test coverage 2026-09-30 21:39:39 +02:00
michal 08a233b2c5 feat(ally): add C1 measurement scaling, update C2 parsing, expand unit tests, and implement configuration enhancements 2026-09-30 10:46:31 +02:00
michal 7aa92d4806 feat(ally): add comprehensive unit tests for Ally optical payloads and protocols, implement new optical codec classes 2026-09-30 07:36:49 +02:00
michal 468bcf786e feat(optical-diagnostics): integrate OpticalTestTrace across test sequences and readers, add diagnostic tracing and enhanced logging 2026-09-29 20:32:34 +02:00
michal 21324985db feat(asic, poseidon): add optical diagnostic logging, enhanced debug controls, and ASIC/Poseidon configuration updates 2026-09-29 12:38:57 +02:00
marekf 4529602d97 <Feature>: Add per-meter export view to ResultsWriter, increase revision to 3.9.3147.110
Cause:

- ResultsWriter exported batch results primarily as one row per meter test.
- File and database Insert outputs also needed one row per meter with selected meter-level values.

Solution:

1. Added configurable row granularity
   - Add the "One row per" selector with Meter test and Meter options.
   - Preserve independent column selections for both views.
   - Keep the existing view as the default for older configurations.

2. Added meter-level variable selection
   - Define meter-view availability in WMeterRsltItemSpec.
   - Filter available variables and hide TestID in the meter view.
   - Reject unsupported mappings before writing output.

3. Extended Insert exports
   - Write one row per enabled meter without a test context.
   - Preserve existing test-level export behavior.
   - Leave XML export and MS SQL stored procedure processing unchanged.

4. Added regression coverage
   - Verify CSV and XLSX row counts, disabled meters and batches without tests.
   - Verify configuration compatibility and selector visibility.
   - Align the test project's System.Memory dependency with the application.
   - All 11 regression tests passed.

5. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.109 to 3.9.3147.110.
2026-09-28 19:35:50 +02:00
marekf bce5af56e0 <Fix>: Persist component settings edited from Previous results, increase revision to 3.9.3147.109
Cause:

- Edit writer and Edit printer changed only the in-memory configuration.
- Confirmed settings were not saved to the database and were lost after restarting the application.

Solution:

1. Added persistent configuration saving
   - Save confirmed changes to the configuration database in a transaction.
   - Preserve component identity, ordering and associations.
   - Roll back failed saves and display an error.

2. Isolated configuration editing
   - Load the latest saved configuration when opening the editor.
   - Keep cancelled edits separate from the running component.
   - Apply saved settings after restarting the application.

3. Added regression coverage
   - Verify saved settings survive reopening the database session.
   - Verify rollback without commit when saving fails.

4. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.108 to 3.9.3147.109.
2026-09-28 13:23:10 +02:00
marekf f8643c4de1 <Fix>: Improve ASIC optical communication logging, increase revision to 3.9.3147.108
Cause:

- ANSI iPerl optical communication needed more detailed diagnostics to investigate communication and parsing failures.
- Optical logs needed batch, test and meter context for troubleshooting.

Solution:

1. Added dedicated optical logging
   - Added AnsiIPerlOptical logger and rolling file appender to the sample configuration.
   - Configured optical diagnostics output to C:\TBF\Logs\AnsiIPerlOptical.txt.

2. Improved communication diagnostics
   - Added session and test markers with batch, meter and repetition details.
   - Added logging of raw HEX and ASCII telegrams, parsed samples and parsing failures.
   - Added logging of port opening errors, read errors and timeouts, including manual reads.

3. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.107 to 3.9.3147.108.
2026-09-28 10:54:15 +02:00
michal 161b20fea7 fix ally in testing + new head
feat(ally): add extensive integration tests, factory seal unseal verification, baud rate discovery, and optical mode enhancements
2026-09-26 14:37:45 +02:00
marekf 882e894fba Merge branch 'feature/task/Universal-feature-UI-button-Show' into ' develop/Local-master' 2026-09-25 09:24:19 +02:00
marekf 79c87bedfd <Feature>: Add ResultsWorkspace for batch results, increase revision to 3.9.3147.107
Cause:

- Batch results needed a more flexible workspace for reviewing and comparing multiple water meters.
- Presentation changes had to remain independent of stored results and legacy view settings.

Solution:

1. Added an independent results workspace
   - Open ResultsWorkspace from Previous Results.
   - Provide Tables overview, Graphs overview and Compare selected tabs.
   - Retain access to the original results view.
   - Preserve serial-number filtering and exclude disabled positions.

2. Improved meter selection and layout
   - Support Ctrl+click selection, Shift+click ranges and All/None actions.
   - Synchronize selection between the meter list, tables and graphs.
   - Add meter reordering, selected-only filtering and independent child windows.
   - Support automatic or explicit grid layouts and configurable visible rows.

3. Improved scrolling and table configuration
   - Add optional linked horizontal and vertical table scrolling.
   - Route the mouse wheel to the overview and Ctrl+wheel to the hovered table.
   - Keep all meters reachable after maximizing and restoring the window.
   - Isolate result fields and column widths from legacy settings and other windows.

4. Added comparison and reusable views
   - Compare selected meters by exact test name.
   - Mark missing results and ambiguous repeated test names.
   - Display relative-error graphs against flow.
   - Save and load XML presentation presets without storing or modifying result data.

5. Added regression coverage
   - Cover filtering, selection, comparison, layout, scrolling and graph rendering.
   - Verify independent window settings and empty-data handling.

6. Increased revision
   - Set AssemblyVersion and AssemblyFileVersion to 3.9.3147.107.
2026-09-25 09:22:16 +02:00
marekf b1324c567c <Feature>: Add universal Schematic drawing editor, increase revision to 3.9.3147.106
Cause:

- The existing schematic editor required time-consuming manual operations.
- Drawing improvements had to preserve compatibility with existing components, pipes and stored schematics.

Solution:

1. Added an alternative schematic editor
   - Keep the original editor available.
   - Preserve the existing database representation and legacy schematic compatibility.
   - Stage drawing changes until Save and support Undo/Redo.

2. Improved canvas interaction
   - Add zoom, panning, automatic fit, multiple selection and canvas search.
   - Add context menus, keyboard shortcuts and component configuration access.
   - Support copying drawing symbols with their internal connections.

3. Added interactive pipe editing
   - Reconnect pipes using endpoint handles.
   - Create bends by dragging selected pipe segments.
   - Stage junctions as J<n>fict and assign final names when saving.
   - Remove straightened automatic bends while preserving manual junctions and branches.
   - Add the Add junction quick action.

4. Added JSON drawing export and import
   - Export drawing geometry and connections without operating settings.
   - Match existing components by name and type.
   - Validate imports and support restoring the previous drawing through Undo.

5. Reorganized the editor layout
   - Move save and close actions into File.
   - Highlight Unlock editing in green until editing is unlocked.
   - Place canvas controls above the bordered canvas.
   - Add a right-side object panel with directional movement and transformation controls.
   - Add optional component types and adaptive palette width.
   - Fit the drawing after maximizing or restoring the window.

6. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.105 to 3.9.3147.106.
2026-09-25 09:17:49 +02:00
marekf d2627be55b <Fix>: Handle missing pipes components in schematic editor, increase revision to 3.9.3147.105
Cause:

- The schematic editor required Pipes components for all four sizes: S, M, L and XL.
- If any size was missing, existing pipes were not loaded and new connections for the missing size were ignored.

Solution:

1. Initialize missing pipes configurations
   - Prepare missing sizes in memory with empty pipe lists.
   - Generate unique component names and append component ordering.
   - Save new components only when confirming the editor with OK.

2. Preserve existing schematic connections
   - Load pipes even when some size components are missing.
   - Normalize null pipe lists to empty arrays.

3. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.104 to 3.9.3147.105.
2026-09-25 09:16:43 +02:00
marekf 2ba6092385 Merge branch 'bugfix/Mexico-NOKvsTestPassed()' into ' develop/Local-master' 2026-09-24 15:06:23 +02:00
marekf fee0651595 <Update>: Version to 3.9.3147.1 in AssemblyInfo files 2026-09-24 15:03:38 +02:00
michal 58fc16d70b Fix point 4. - take % validation from procedure to Q3 Calib factor CH1-3 verification
Implement error limit configuration for Q3 calibration factors.

- Add default and configurable error limits for Q3 calibration validation.
- Introduce `CalculateQ3CalibrationWithErrorLimits` for flexible validation handling.
- Overhaul Q3 workflow to respect configured limits, with fallback to defaults.
- Extend tests for calibration, including boundary and invalid inputs.
2026-09-24 14:53:49 +02:00
marekf ddf8996f01 <Fix>: Fit Previous Results columns to content, increase revision to 3.9.3147.104
Cause:

- Fixed column widths left unnecessary empty space and did not adapt to displayed values.
- Action buttons required sizing that accounts for captions, icons and padding.

Solution:

1. Added content-based column sizing
   - Fit Batch, Start time, End time, SW version, OK and NOK to headers and formatted values on the current page.
   - Recalculate widths when the grid is created or the displayed page changes.
   - Preserve manual resizing between page changes.

2. Adjusted action button widths
   - Fit OK/NOK diag, Write, the mode-dependent action and Show to their captions.
   - Include icon width and button padding.
   - Keep Procedure and Purchase order filling the remaining space.

3. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.103 to 3.9.3147.104.
2026-09-24 11:01:56 +02:00
marekf 0c2cc0dad2 <Feat>: Add batch OK/NOK diagnostics, increase revision to 3.9.3147.103
Cause:

- Previous Results displayed overall OK/NOK counts without explaining why a meter failed.
- Individual tests could show TestPassed() = Yes while the overall verdict was NOK due to other failed or incomplete tests or error flags.
- Stored verdicts could not be easily compared with evaluation of saved test results.

Solution:

1. Added batch OK/NOK diagnostics
   - Added an "OK/NOK diag" action to Previous Results.
   - Displayed stored and recalculated verdicts for each meter and highlighted mismatches.
   - Identified failed or incomplete evaluated tests and contributing error flags.

2. Added detailed diagnostic reports
   - Included test names, repetitions, completion states, measurements, limits and timestamps.
   - Distinguished error flags from information flags that do not cause NOK.
   - Added copying of the full report.
   - Kept diagnostics read-only without changing stored results or evaluation rules.

3. Added unit tests
   - Covered incomplete tests, error flags, excluded tests and verdict mismatches.
   - Covered failed repetitions and missing test definitions.

4. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.102 to 3.9.3147.103.
2026-09-24 09:31:18 +02:00
marekf 1e0c65f213 <Fix>: Improve crash diagnostics, increase revision to 3.9.3147.102
Cause:

- The Out of memory error occurred while creating the WinForms error dialog, potentially masking the original exception.
- Crash logs lacked resource usage details needed to investigate memory or graphics resource exhaustion.

Solution:

1. Improved exception logging
   - Added first-chance logging for memory and native exceptions.
   - Included full exception details, HRESULT, native error code and termination status.
   - Protected logging against recursion and diagnostic failures while preserving existing exception handling.

2. Added resource diagnostics
   - Logged process memory usage, handle and thread counts.
   - Recorded current and peak GDI and USER object counts.
   - Included application version, thread ID and process architecture.

3. Increased revision
   - Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.101 to 3.9.3147.102.
2026-09-24 08:31:30 +02:00
marekf c53a2d9078 Merge branch 'bugfix/SLM-PT150-9-2026-RR-units-FSMC-QuantMt-empty' into ' develop/Local-master' 2026-09-23 12:20:24 +02:00
marekf 6223bc925f <Update>: Version to 3.9.3147.0 in AssemblyInfo files 2026-09-23 12:18:13 +02:00
marekf aca1d79023 Merge branch 'feature/task/Universal-feature-styled-Previous-result' into feature/task/UnionTown-Cordonel-completion-at-the-customer-milestone 2026-09-23 12:15:46 +02:00
marekf 45d12dea6f <Fix>: Fix FSMC mass meter test results and preserve final master pulse count, increase revision to 3.9.3147.101
Cause:

- The calculated mass meter quantity was not assigned to meterRslt.MassMeter, leaving Quant Mt empty after the test ended.
- tstRslt.PulsesMaster was read directly from cBrd.RefPulses during final result processing, when the value could already be reset or changed.

Solution:

1. Fixed mass meter result calculation
   - Calculated meterRslt.MassMeter from meterRslt.PulsesMeter and regReader.LtrsPerPulse.
   - Ensured that Quant Mt is available in the final test results.

2. Preserved the final master pulse count
   - Captured cBrd.RefPulses in finalPulsesCount during the measurement loop.
   - Used the preserved value when assigning tstRslt.PulsesMaster.

3. Increased revision
   - Updated revision to 3.9.3147.101.
2026-09-22 15:06:24 +02:00
marekf 2cee6cb0f2 <Feat>: Replace Previous Results layout with DataGridView and add procedure access, increase revision to 3.9.3146.122
Cause:

- The custom row controls caused slow resizing and repainting.
- Column resizing required manual synchronization between rows and headers.
- Test procedures could not be opened directly from previous results.

Solution:

1. Replaced the custom results layout
   - Added a double-buffered DataGridView with native column resizing and scrollbars.
   - Removed the resize timer and per-row control layout.
   - Added full-row selection and automatic row heights to fill the available space.
   - Deferred row-height updates until fill-column resizing completes.
   - Centered the window on screen and added bottom spacing.

2. Improved table appearance
   - Centered columns except Procedure and Purchase order.
   - Highlighted positive OK/NOK counts with green/red backgrounds and white text.
   - Kept zero counts neutral.
   - Strengthened the selected-row background.
   - Added gray Write/Print buttons and a blue Show button with embedded PNG icons.
   - Restricted hover highlighting to the actual button area.

3. Added direct procedure access
   - Made procedure names clickable.
   - Loaded the exact procedure name and revision recorded in the batch.
   - Opened active revisions in locked editing mode with existing authorization.
   - Saved accepted changes as a new revision and archived the original.
   - Opened historical revisions as read-only.
   - Reported missing or ambiguous procedure matches.

4. Preserved existing behavior and compatibility
   - Retained filters, paging, printing, writing, result viewing and build-specific actions.
   - Used FlushMode.Never with explicit Flush() for the existing NHibernate version.
   - Corrected embedded-resource naming and image disposal.
   - Added English code documentation and cleaned up source formatting.

5. Increased revision
   - Updated revision to 3.9.3146.122
2026-09-22 12:19:50 +02:00
michal e9cda221bb feat(smart-comm): enhance logging, add family selection mask handling, and improve close behavior 2026-09-21 19:23:22 +02:00
michal c6181a76ec feat(asic): implement ASIC reader and test method integration with legacy compatibility, add detailed logging and new unit tests 2026-09-21 14:08:02 +02:00
marekf cd24373c80 <Fix>: Restore volume and mass unit selection in register reader procedures, increase revision to 3.9.3147.100
Cause:

* The Units combobox in StandingStartStop and PulsesFromUniCB filtered units by MultiFunctionalVariables, leaving volume and mass units unavailable.
* StandingStartStop.QuantityUnits was not connected to the unit stored in procedure parameters.

Solution:

1. Updated unit selection

   * Replaced the MultiFunctionalVariables filter with Volume and Mass filters in both components.
   * Preserved the default "---" option.

2. Connected runtime units to procedure parameters

   * Updated StandingStartStop.QuantityUnits to read and write ProcParams.Units.
   * Aligned unit handling with PulsesFromUniCB.

3. Increased revision

   * Updated revision to 3.9.3147.100.
2026-09-18 13:47:15 +02:00
marekf a464b1fc21 <Feat>: Add per-meter simulation outcomes and retry scenarios, increase revision to 3.9.3146.121
Cause:

- Simulation Success applied the same result to every meter in a test.
- Mixed failures and successful retries could not be reproduced reliably.

Solution:

1. Added per-slot simulation configuration
   - Add the Simulation slot results procedure parameter.
   - Support sequences such as 4=Fail,Pass; 7=Fail,Fail,Pass.
   - Preserve existing defaults for unspecified slots.
   - Repeat the last configured outcome when its sequence is exhausted.

2. Integrated outcomes with existing retries
   - Track outcomes independently for each slot and operation.
   - Reset counters for each new test invocation.
   - Retry only failed slots within the configured retry count.
   - Preserve previously successful slot results and selection.

3. Improved result reporting
   - Use individual slot outcomes for phase status and TBF results.
   - Log the configured outcome and its source.
   - Prevent stale outcomes from affecting later tests.

4. Preserved physical execution
   - Keep measurement algorithms, timing, parallel execution and port handling unchanged.

5. Increased revision
   - Update revision to 3.9.3146.121.
2026-09-18 13:44:03 +02:00
michal b8f6af7112 Fix point 4. - take % validation from procedure to Q3 Calib factor CH1-3 verification
Implement error limit configuration for Q3 calibration factors.

- Add default and configurable error limits for Q3 calibration validation.
- Introduce `CalculateQ3CalibrationWithErrorLimits` for flexible validation handling.
- Overhaul Q3 workflow to respect configured limits, with fallback to defaults.
- Extend tests for calibration, including boundary and invalid inputs.
2026-09-16 10:23:04 +02:00
michal 1c8d01562f Ally meter integration to test method and unit tests / integration tests supports Ally communication improving
feat(ally): add detailed logging, calibration flow updates, and test communication sequence implementation
2026-09-16 09:30:50 +02:00
marekf 2608ee4de6 Merge branch 'feature/task/UnionTown-Cordonel-completion-at-the-customer-last-task-11' into feature/task/UnionTown-Cordonel-completion-at-the-customer-milestone 2026-09-15 20:25:58 +02:00
marekf e63f706f41 <Fix>: Handle scale underload before mass measurement, increase revision to 3.9.3146.120
Cause:

- Starting measurement overwrote Underload with Busy.
- IND400 then returned S I, causing repeated measurements without zeroing.

Solution:

1. Check underload before measurement in both Mettler Toledo implementations.
2. Zero the scale first and resume measurement after successful zeroing.
3. Return an error if zeroing fails or times out.
4. Preserve existing SICS and ID1 commands and response handling.
5. Increased revision to 3.9.3146.120.
2026-09-15 20:25:08 +02:00
marekf 94cd07cd3c <Fix>: Add volume and mass units for multifunctional Results variables, increase revision to 3.9.3146.119
Cause:

- The units combobox offered no physical units for MultiFunctionalVariables, including Quant. Mt. and Quant. rm.

Solution:

1. Extended unit selection
   - Include both volume and mass units for MultiFunctionalVariables.
   - Preserve existing result formatting and unit conversion.

2. Increased revision
   - Update revision to 3.9.3146.119.
2026-09-15 19:15:01 +02:00
marekf 967ca817ba Merge branch 'feature/task/UnionTown-Cordonel-completion-at-the-customer-last-task-2-3' into feature/task/UnionTown-Cordonel-completion-at-the-customer-milestone 2026-09-15 18:43:52 +02:00
marekf 979637cc07 <Fix>: Correct initial filling behavior for Start Cycle and Start Test, increase revision to 3.9.3146.118
Cause:

- Start Cycle bypassed the configured Purge Begin transition.
- Start Test prompted for filling only when FillState was Full, skipping confirmation after application startup when the state was Unknown.

Solution:

1. Restored automatic cycle filling
   - Remove Selection.Cycle from the filling bypass condition.
   - Execute the configured Purge Begin transition on initial cycle startup without confirmation.

2. Corrected Start Test confirmation
   - Remove the FillState.Full condition.
   - Ask whether to fill on initial Start Test regardless of the recorded fill state.
   - Preserve Yes/No and STOP handling.

3. Preserved existing restore behavior
   - Keep filling confirmation for restored batches.
   - Keep the filling bypass for restored interrupted sessions.

4. Increased revision
   - Update revision to 3.9.3146.118.
2026-09-15 18:42:53 +02:00
marekf 5c7ff08a78 <Fix>: Remove blocking UI access from preadjustment retries, fixed last-task-9 increase revision to 3.9.3146.117
Cause:

- Retry preparation called SetChecked(true), introducing synchronous UI access before the next phase attempt.
- This could stall retries and delay operator STOP.

Solution:

1. Fixed retry preparation
   - Restore Failed, Ok and IsEnabled directly without updating the checkbox.
   - Check cancellation while preparing slots for the next attempt.
   - Preserve existing phase execution, parallel processing and streaming port ownership.

2. Increased revision
   - Update revision to 3.9.3146.117.

Validation:

- Confirmed working retry behavior on the test bench.
2026-09-15 16:07:20 +02:00
marekf a64d1a82ed <Fix>: Enable editing of water meter error limits, increase revision to 3.9.3146.116
Cause:

- ErrLimHiQ and ErrLimLoQ were missing from parameter validation and update handling.
- Editing either limit produced an Invalid index message.

Solution:

1. Fixed error limit editing
   - Add validation for parameter indices 10 and 11.
   - Assign edited values to ErrLimHiQ and ErrLimLoQ.
   - Use the existing non-negative numeric parsing.

2. Increased revision
   - Update revision to 3.9.3146.116.
2026-09-15 02:36:44 +02:00
marekf bf1766f90a <Feat>: Add default purchase order without dialog, increase revision to 3.9.3146.115
Cause:

- Cycle start required manual purchase order confirmation even when no specific order was needed.

Solution:

1. Added default purchase order configuration
   - Add Default (without dialog) to the Orders selection.
   - Add a configurable default purchase order, initially DEFAULT.
   - Validate 1 to 10 characters without whitespace or control characters.

2. Added automatic order assignment
   - Assign the default order to all meters in the current batch.
   - Skip creating and displaying CycleBeginningForm.
   - Clear previous order details and complete through the existing operation flow.

3. Preserved existing behavior
   - Keep manual and Oracle order modes unchanged.
   - Preserve compatibility with existing configurations.

4. Increased revision
   - Update revision to 3.9.3146.115.
2026-09-15 02:27:03 +02:00
marekf 1b789ad5d5 Merge branch 'feature/task/UnionTown-Cordonel-completion-at-the-customer-last-task-2-3' into feature/task/UnionTown-Cordonel-completion-at-the-customer-milestone 2026-09-15 01:41:38 +02:00
marekf a7404d0e24 Merge branch 'feature/task/UnionTown-Cordonel-completion-at-the-customer-last-task-5' into feature/task/UnionTown-Cordonel-completion-at-the-customer-milestone 2026-09-15 01:39:58 +02:00
marekf a64327ac36 <Fix>: Adjust filling behavior and fix parallel flow meter configuration, increase revision to 3.9.3146.113
Cause:

- Start Cycle could prompt for filling before executing the procedure.
- Start Test bypassed the filling confirmation.
- Parallel flow meter configuration threw NotImplementedException during XML serialization of IsOffline.

Solution:

1. Updated Start Cycle
   - Proceed directly to the procedure, allowing its Purge Begin step to handle filling.

2. Updated Start Test
   - Ask whether to fill with water when FillState is Full.
   - Preserve the existing filling path for other fill states.
   - Keep restored-batch confirmation and STOP handling.

3. Fixed parallel flow meter configuration
   - Replace the unimplemented IsOffline accessors with an automatic property.
   - Preserve IsOffline when copying configuration.
   - Prevent the exception when opening component configuration.

4. Increased revision
   - Update revision to 3.9.3146.113.
2026-09-15 01:37:33 +02:00
marekf c886303458 <Fix>: Add US flow units for parallel flow meters, increase revision to 3.9.3146.113
Cause:

- Parallel flow meter configuration offered only m3/h and l/h.

Solution:

1. Extended display unit selection
   - Add gal/m to the available display units.

2. Increased revision
   - Update revision to 3.9.3146.113.

ToDo:

- Map gal/m to the corresponding US gallons per minute unit in UpdateParam.
2026-09-15 01:03:33 +02:00
marekf 38003592df <Fix>: Adjust filling behavior for Start Cycle and Start Test, increase revision to 3.9.3146.114
Cause:

- Start Cycle could prompt for filling before executing the procedure.
- Start Test bypassed the filling confirmation.

Solution:

1. Updated Start Cycle
   - Proceed directly to the procedure, allowing its Purge Begin step to handle filling.

2. Updated Start Test
   - Ask whether to fill with water when FillState is Full.
   - Preserve the existing filling path for other fill states.

3. Preserved existing controls
   - Keep restored-batch filling confirmation.
   - Keep STOP handling during the confirmation.

4. Increased revision
   - Update revision to 3.9.3146.114.
2026-09-15 01:01:30 +02:00
marekf 82c2b17a1f <Feat>: Add per-phase retries for failed preadjustment slots, increase revision 3.9.3146.112
Cause:

- Failed meters were excluded without retrying the current phase.
- The procedure Temperature column was redundant when using T1/T2 sensors.

Solution:

1. Added configurable retries
   - Replace the Temperature column with Retries on failure.
   - Interpret the value as additional attempts; default to zero.
   - Preserve legacy Temperature XML compatibility.

2. Added failed-slot retry execution
   - Retry only failed slots, in parallel, within the current phase.
   - Preserve successful slots and their captured results.
   - Restore the complete GCI batch after each attempt.
   - Exclude unsuccessful slots after retries are exhausted.

3. Improved attempt diagnostics
   - Log attempt numbers and outcomes to slot windows and files.
   - Keep successful slot tabs visible during retries.

4. Preserved execution behavior
   - Keep existing measurement algorithms, sensor readings and port handling.
   - Process STOP during retries and hold once after all attempts finish.
   - Prevent further retries after cancellation or streaming cleanup failure.

5. Increase revision 3.9.3146.112
2026-09-15 00:01:53 +02:00
marekf 2660c564a6 <Feat>: Expose Genesis preadjustment results in Results and improve result mapping
Cause:

- Preadjustment values were not available for persistent Results mapping.
- Older Genesis item IDs could resolve to different result variables.
- Meter-specific variables were difficult to find.

Solution:

1. Added preadjustment result storage
   - Store common execution metadata and available phase-specific values per slot and test.
   - Expose temperature comparison and Completion values in Results.
   - Preserve existing measurement execution, timing, parallelism and STOP handling.

2. Improved result selection
   - Add Water meter type under the existing Category tab.
   - Group available items into Common, Genesis and iPerl.

3. Corrected saved mappings
   - Migrate recognized legacy Genesis mappings.
   - Store stable item identifiers while preserving existing numeric IDs.
   - Mark ambiguous mappings as Review mapping.
   - Preserve the one-based Genesis repetition number.
2026-09-14 22:48:10 +02:00
marekf 7e2b4ed908 Merge branch 'feature/task/UnionTown-Cordonel-completion-at-the-customer-last-task-6' into feature/task/UnionTown-Cordonel-completion-at-the-customer-milestone 2026-09-14 19:31:10 +02:00
marekf c1960f2150 <Feat>: Add per-slot preadjustment file logs and diagnostic headers, increase revision to 3.9.3146.110
Cause:

- Preadjustment diagnostics required persistent log files for each slot.
- Phase boundaries and file storage outcomes were not clearly visible.

Solution:

1. Added per-slot file logging
   - Store logs under C:\Tbf\Logs\Preadjustment.
   - Create a separate directory for each batch and a separate file for each slot.
   - Capture phase diagnostics, Completion SQL messages and STOP requests.
   - Support normal execution and simulation independently of the diagnostic window.

2. Added phase formatting
   - Add batch and phase headers with slot and start time.
   - Include phase result and duration in file footers.
   - Display headers in the corresponding slot diagnostic window without duplicate file entries.

3. Added file storage diagnostics
   - Display the full log path and creation/write status per slot.
   - Confirm successful writes after closing the file.
   - Report write failures and incomplete logs.

4. Added background file writing
   - Buffer and write log entries without blocking serial reception.
   - Preserve parallel slot execution and existing calibration behaviour.

5. Increased revision
   - Updated revision from 3.9.3146.109 to 3.9.3146.110.
2026-09-14 19:00:39 +02:00
marekf 4124443f36 <Feat>: Add Completion and Q3 calibration database writes through GCI, increase revision to 3.9.3146.109
Cause:

- Preadjustment Completion and TBF Q3 calibration results required configurable database persistence.
- Both write operations required diagnostics and simulation support.

Solution:

1. Added independent database writer configurations
   - Added PreadjustmentCompletionWriter and Q3CalibrationWriter to gci_config.
   - Support SQL commands, stored procedures and parameter mappings.
   - Added SQL table creation and verification scripts.

2. Added Preadjustment Completion storage
   - Store PCB ID, meter size, amplitude settings, temperature offsets, zero-flow offsets, timestamp and overall result.
   - Use captured Completion readout values.
   - Preserve the original HTTP reporting.
   - Report SQL connection and write status in the corresponding slot diagnostics.

3. Added Q3 calibration storage
   - Forward TBF results through GCI Bridge to the GCI database API.
   - Store signed deviations and written calibration factors for all three paths.
   - Write to SQL after successful calibration register writes and StoreCalibration.
   - Include PCB ID and UTC timestamp.

4. Added simulation support
   - Generate sample Completion and Q3 records for simulated slots.
   - Perform real SQL writes when the corresponding writer is enabled.
   - Log connection progress, write outcomes and generated record IDs.

5. Separated calibration and database outcomes
   - Preserve meter operation results when database storage fails.
   - Expose database write status independently.

6. Increased revision
   - Updated revision from 3.9.3146.108 to 3.9.3146.109.

Validation:

- Confirmed successful SQL storage for simulated Completion.
- Confirmed successful Q3 calibration result storage.

ToDo:

- Use the GCI Q3 storage API as the foundation for future migration of Q3 calibration from the direct TBF communication branch to GCI.
2026-09-14 17:06:22 +02:00
marekf 6bab62a062 <Fix>: Integrate GCI and direct streaming workflows, restore parallel preadjustment execution and update revision to 3.9.3146.108
Cause:

- GCI streaming port ownership interfered with regular TBF measurements using direct streaming access.
- Streaming handoff recreated both connections and required unnecessary login attempts between phases.
- Sequential port acquisition delayed execution, while unavailable meters could prevent healthy slots from continuing.
- Repeated initialization retained exclusions from the previous attempt.

Solution:

1. Integrated two communication approaches
   - Enable coexistence of the GCI Bridge workflow, which uses request and streaming ports, and the TBF workflow, which accesses the streaming port directly.
   - Transfer streaming port ownership explicitly between both workflows.
   - Preserve the GCI request connection and authentication during streaming handoff.

2. Updated ExternalProjects - GenesisCore/GenesisMeter
   - Added ConnectStreamingPort and DisconnectStreamingPort.
   - Separate streaming port lifecycle from request connection lifecycle.
   - Allow streaming port ownership to move between both technological branches without reconnecting the request port or repeating login.
   - Preserve process configuration and release streaming resources on completion, cancellation or acquisition failure.

3. Updated ExternalProjects - CordonelPreadjustmentUi
   - Adapt ZeroFlowGenesisMeter data collection to streaming port handoff.
   - Support repeated StartRecordData calls without duplicate subscriptions.
   - Prevent duplicate record processing and repeated amplitude scaling.
   - Coordinate preadjustment data subscription startup and shutdown with streaming ownership.

4. Restored parallel slot handling
   - Acquire, check and release ports concurrently across slots.
   - Isolate unavailable or failed meters without excluding healthy slots.
   - Drain pending operations before cleanup on STOP.

5. Corrected repeated execution and results
   - Reset exclusions and result state on explicit preadjustment initialization.
   - Evaluate results separately for each slot.
   - Prevent empty phases from being reported as successful measurements.
   - Return the streaming port for subsequent non-GCI measurements.

6. Updated revision
   - Set revision to 3.9.3146.108.

Related dependency changes:

- This commit requires the corresponding changes in:
  - ExternalProjects - GenesisCore/GenesisMeter.
  - ExternalProjects - CordonelPreadjustmentUi.
- Build and deploy both updated assemblies together with the matching TBF/GCI changes.

Architecture milestone:

- Established functional integration of two communication architectures: GCI Bridge access to both ports and direct TBF access to the streaming port.
- This version, together with the corresponding ExternalProjects changes, provides the baseline for their future unification.

ToDo:

- Use this baseline to unify request and streaming communication behind the GCI interface.
- Migrate remaining direct streaming access to GCI while preserving parallel slot execution, cancellation and diagnostic logging.
- Centralize ownership and lifecycle management of both ports in GCI.
2026-09-12 00:23:37 +02:00
marekf c426df990c <Feat>: Add per-slot temperature calibration results, diagnostic hold and settling delay, increase revision to 3.9.3146.107
Cause:

- Temperature calibration results lacked measured meter temperatures and comparison details.
- Diagnostics closed immediately after a phase, preventing inspection of failures.
- Push Temperature remained visible when temperature was supplied directly from T1/T2.
- Automatic phase transitions provided insufficient settling time before temperature calibration, causing temperature checks to fail.

Solution:

1. Added structured temperature calibration results
   - Return reference temperature, meter temperature, absolute difference, effective limit and sample count per slot.
   - Distinguish temperature check status from overall calibration completion.
   - Preserve existing API signatures and add typed result methods.

2. Improved temperature diagnostics
   - Log sample count, invalid values, minimum, maximum and mean for each path.
   - Add bounded TEMP-RAW capture with raw temperature, scaling factor, decoded temperature, timestamps and frame content.
   - Attach diagnostic capture only during the temperature check and detach it afterwards, including on cancellation.
   - Preserve the original streaming handler used during Amplitude Test.
   - Keep the original comparison algorithm and temperature deviation limit.
   - Remove configurable deviation from the GCI Bridge component dialog.

3. Added optional hold after preadjustment
   - Add the Hold after preadjustment procedure parameter.
   - Keep completed results and diagnostics visible until Continue is pressed.
   - Process STOP during hold and exclude hold time from measurement duration.

4. Updated phase display
   - Hide Push Temperature in sensor mode unless that action is explicitly running.
   - Keep failed slots and their exclusion status visible during hold.

5. Corrected settling time
   - Remove initialization overrides that forced OffsetTestSettlingTime to zero.
   - Set OffsetTestSettlingTime to 20 seconds.
   - Apply settling before temperature calibration and during Offset Test.
   - Preserve STOP handling during the wait.
   - The existing inclusive countdown produces approximately 21 seconds of waiting.

6. Aligned project versions
   - Update TBF revision to 3.9.3146.107.
   - The corresponding Laatzen PreadjustmentUI project state matches this TBF revision exactly.
   - Build and deploy these matching project versions together.

Validation:

- Compared raw temperature frames from GCI GUI and GenesisCommunication.
- Confirmed that decoded Meter temperatures matched the raw frame values.
- Confirmed that adding a pause after Amplitude Test allowed temperature calibration to pass.
2026-09-11 19:05:17 +02:00
marekf 20614fb9e6 <Fix>: Add real-time slot progress logging to Offset Test, increase revision to 3.9.3146.106
Cause:

- Settling and data collection updated only StatusLabel, leaving slot diagnostic memos without progress messages.
- One error message had no slot assigned and was ignored by slot diagnostics.

Solution:

1. Added slot-specific progress logging
   - Log settling countdown every second.
   - Log collected record count every collection cycle.
   - Log completion of data collection.

2. Corrected error routing
   - Include slot and PCB ID in the bad-data warning.

3. Preserved test behaviour
   - Keep existing timing, calculations and validation unchanged.

4. Increased revision
   - Updated revision to 3.9.3146.106.
2026-09-11 03:49:31 +02:00
marekf 302431b64c <Fix>: Add skipped preadjustment phase state and improve diagnostic colors, increase revision to 3.9.3146.105
Cause:

- Optional preadjustment phases remained in the Pending state after a later phase had already started.
- Running and skipped phases required clearer visual distinction.

Solution:

1. Improved preadjustment phase states
   - Mark preceding unexecuted phases as Skipped when a later preadjustment phase starts.
   - Allow a skipped phase to transition normally to Running if it is executed later.

2. Improved diagnostic colors
   - Display running phases in blue.
   - Display skipped phases in orange.
   - Preserve green for passed, red for failed and grey for pending phases.

3. Increased revision
   - Updated revision to 3.9.3146.105.
2026-09-11 03:12:31 +02:00
marekf db34c579d0 <Fix>: Correct GCI streaming port ownership for preadjustment, increase revision to 3.9.3146.104
Cause:

- GenesisRegReader configured the GCI streaming port as NA.
- GCI Bridge therefore received no calibration streaming data during the Amplitude Test.
- The request port remained functional, so register writes succeeded while TOF data collection failed.

Solution:

1. Corrected streaming port ownership
   - Pass the configured Genesis opto COM port to GCI Bridge as the UART streaming port.
   - Stop GenesisRegReader streaming before handing the port over to GCI Bridge.
   - Validate request and streaming ports during preadjustment detection.
   - Release the GCI connection after preadjustment so the port can be reused by subsequent tests.

2. Increased revision
   - Updated revision to 3.9.3146.104.
2026-09-11 02:49:09 +02:00
marekf 83afddc918 <Feat>: Add real-time Genesis preadjustment diagnostics and configurable per-slot simulation, increase revision to 3.9.3146.103
Cause:

* Genesis preadjustment activities lacked a dedicated real-time diagnostic view.
* It was difficult to monitor slot workers, requests, phase progress and slot-specific logs during execution.
* GCI Bridge simulation did not provide configurable timing and results for individual preadjustment activities.
* Failed slots could incorrectly continue in subsequent preadjustment phases.
* Live log refresh prevented reliable scrolling and copying while messages were arriving.

Solution:

1. Added preadjustment diagnostic logging

   * Added detailed logging for GenesisCommunication preadjustment execution.
   * Added GCI Bridge worker, queue, request and operation diagnostics.
   * Routed diagnostic messages through AppDiagnostic.

2. Added a dedicated preadjustment diagnostics form

   * Opens automatically while a preadjustment activity is running.
   * Closes automatically when the activity finishes.
   * Uses a stable position within the TBF results area.
   * Displays GCI slot and worker status in real time.

3. Added dynamic slot diagnostics

   * Creates a tab for every selected slot.
   * Displays all eight preadjustment phases.
   * Shows Pending, Running, Passed and Failed states using distinct colors.
   * Preserves phase history between independently executed activities.
   * Keeps failed and excluded slots visible.

4. Added slot-specific live logs

   * Routes progress and simulation messages to the corresponding slot memo.
   * Appends only new messages instead of replacing the complete text.
   * Preserves the operator's scroll position while new messages arrive.
   * Removed duplicate timestamps.

5. Added configurable preadjustment simulation

   * Added configurable simulation duration, Success and ErrorMessage parameters.
   * Added per-operation simulation profiles to GCI Bridge.
   * Applies procedure-specific simulation values dynamically before executing a GCI operation.
   * Rejects invalid simulation-mode combinations.

6. Added parallel per-slot simulation workers

   * Executes simulated preadjustment operations independently for every selected slot.
   * Uses a dedicated worker and queue state for each slot.
   * Waits for all participating operations using Task.WhenAll.
   * Aggregates individual slot results into the batch result.

7. Added failed-slot exclusion

   * Stores preadjustment results for the current batch.
   * Excludes failed slots from subsequent preadjustment activities.
   * Keeps excluded slots visible and marked as failed.
   * Limits exclusion to preadjustment activities.

8. Increased revision

   * Updated revision to 3.9.3146.103.

Validation:

* Confirmed real-time phase and slot diagnostics.
* Confirmed parallel simulation using dedicated slot workers.
* Confirmed configurable simulation timing and results.
* Confirmed live slot logs remain scrollable and copyable.
2026-09-11 02:36:17 +02:00
marekf cf77faf972 kick 2 - prva dobra s dialogom testov 2026-09-11 00:33:16 +02:00
michal 684513ee59 Fix Genesis scheduling and synchronization for up to 10 workers 2026-09-10 22:09:30 +02:00
marekf 45a6d59b5e kick1 - priebezne stabilne - pred velkym zadanim 2026-09-10 21:39:00 +02:00
marekf 73c8fecdf2 <Update>: Version to 3.9.3146.102 in AssemblyInfo files 2026-09-10 17:52:22 +02:00
marekf 8c77df207a <Feat>: Add universal NLog diagnostics and improve AppDiagnostic UI
Cause:

- Live diagnostics required logging from multiple applications without blocking TBF.
- Shared nlog.config files caused configuration conflicts.
- The original viewer lacked configurable colors and practical log controls.
- Inconsistent diagnostic deployment caused log transfer failures and locked shared DLLs during builds.

Solution:

1. Added universal diagnostic transport
   - Added AppDiagnostic.Logging with an NLog target and named-pipe communication.
   - Added background buffering and automatic reconnection.
   - Registered the diagnostic connector programmatically.

2. Separated diagnostic window lifecycle
   - Run AppDiagnostic as an independent process.
   - Activate the existing window on repeated launches.
   - Keep TBF running when the diagnostic window closes.

3. Corrected diagnostic deployment
   - Copy the complete diagnostic output into a dedicated AppDiagnostic subdirectory during build.
   - Overwrite existing deployment files to prevent inconsistent versions.
   - Validate and launch the executable from that subdirectory with an explicit working directory.

4. Improved the log viewer
   - Added configurable substring colors with a palette and live preview.
   - Added text, level and application filters.
   - Added line wrapping, clipboard actions and log export.
   - Added Pause/Resume, Refresh, Clear, auto-scroll and Always on top.
   - Added connection and log counters.
   - Persist color rules between sessions.

5. Removed legacy dependencies
   - Replaced LiveLogCache with structured diagnostic storage.
   - Removed AppDiagnostic dependencies on log4net and SharedComponents.

Validation:

- Confirmed successful log transfer when launching AppDiagnostic from TBF.
2026-09-10 17:45:29 +02:00
marekf 1c6f9af2bb <Feat>: Add standalone Genesis preadjustment activities, fix configuration control and increase revision to 3.9.3146.101
Cause:

- GenesisCommunication did not expose GCI preadjustment phases as selectable test activities.
- Meter size and temperature inputs required by preadjustment could not be configured.
- The configuration control incorrectly expected the iPerlCommunication configuration type.
- Preadjustment results were not propagated to TBF test and meter results.

Solution:

1. Added standalone preadjustment activities
   - Added Initialization, Detect, Preparation, Amplitude Test, Temperature Calibration, Push Temperature, Offset Test and Completion.
   - Each phase can be selected and executed independently.

2. Added preadjustment parameters
   - Added configurable meter size and temperature.
   - Added validation and supported meter-size selection.

3. Added batch preadjustment execution
   - Resolves enabled Genesis register readers and their slots.
   - Verifies that all readers use the same GCI Bridge instance.
   - Dispatches the selected activity through the corresponding GCI Bridge API.

4. Added result processing
   - Stores execution time and completion status.
   - Updates test and meter results according to the GCI response.

5. Fixed the configuration control
   - Corrected TestMethodCfgCtrl to accept the GenesisCommunication TestMethodCfg type.

6. Increased revision
   - Updated revision to 3.9.3146.101.
2026-09-10 14:08:00 +02:00
marekf 0cfde7f06b <Update>: Version to 3.9.3146.0 in AssemblyInfo files 2026-09-09 17:31:27 +02:00
marekf d3c361b544 <Merge-fix>Solve merge conflicts - multichange: PassedFromTests() renamed to PassedFromAllTests() 2026-09-09 17:28:19 +02:00
marekf b35b7d92f9 <Merge-fix> Solve merge conflicts 2026-09-09 17:27:35 +02:00
michal 52bd0d01ce Restore Genesis communication and Q3 calibration from special branches
A – Registration and execution
- Register GenesisCommunication Factory in the component list.
- Separate the Genesis form and sequence from iPerl communication.

B – Communication activities
- Restore initialization, connection, PCB reading, password and login.
- Include grouped login, mode switching and disconnection.
- Support processing up to 10 slots.

C1 – Input calibration factors
- Read three factors from Water meters / Text1–Text3.
- Validate integer values in the range 1–65535.
- Preserve the default of 15625 when all three fields are empty.

D – Q3 calibration
- Connect the Prepare Q3 → measurement → Write Q3 workflow.
- Add channel processing to FlyingStart and FlyingStartMassCollection.
- Reset previous measurement data and validate calculated factors.
- Mark factors as stored only after StoreCalibration succeeds.

E – Results and database
- Store calibration factors separately for each meter and channel.
- Add result entities, mappings and Q3 data.
- Extend DB.cs / EnsureSchema to create and update the schema.
- Preserve compatibility with the existing binary format.

Validation:
- Debug build and 18 tests passed.
- Simulated communication runs follow the same activity sequence.
- The complete Q3 workflow has not yet been verified on hardware.

Known limitation:
- An inherited mismatch in simulated responses and error propagation
  can produce an incorrect OK result; this change does not fix it.
2026-09-09 15:04:49 +02:00
marekf eb4f7ad971 <Fix>: Prevent component configuration crashes, add a copyable error dialog, increase revision to 3.9.3145.109
Cause:

* A configuration control can reject an incompatible configuration and return null.
* ComponentsManagerDlg accessed the rejected configuration without validation, causing a NullReferenceException and closing TBF.
* The standard MessageBox was difficult to read and did not provide convenient access to technical details.

Solution:

1. Added configuration validation

   * Validates the configuration returned by the component control.
   * Logs the rejected control and configuration types.
   * Cancels the add operation without terminating TBF.

2. Added a reusable error details dialog

   * Displays a clear error summary and structured technical details.
   * Allows the diagnostic text to be selected and copied.
   * Added Copy and Close actions and registered the new form in TBF.csproj.

3. Increased revision

   * Updated revision to 3.9.3145.109.
2026-09-09 10:09:49 +02:00
marekf 8677e49680 <Fix>: Correct GciBridge component class name generation, increase revision to 3.9.3145.108
Cause:

- GciBridge Factory used an incorrect namespace substring offset when generating the component class name.
- The generated value was `geComponents.GciBridge` instead of `BridgeComponents.GciBridge`.
- The invalid class name could prevent correct component registration and lookup.

Solution:

1. Corrected class name generation
   - Changed the namespace substring offset from 12 to 8.
   - GciBridge Factory now returns the correct `BridgeComponents.GciBridge` class name.

2. Restored component identification
   - GciBridge can now be registered and resolved using the expected TBF component class name.

3. Increased revision
   - Updated revision to 3.9.3145.108.
2026-09-08 22:00:31 +02:00
marekf 29faef86e3 <Fix>: Prevent GciBridge startup failure when storage components are unavailable, increase revision to 3.9.3145.107
Cause:

- GciBridge threw an exception when the configured UniDataStorageReader or UniDataStorageWriter was not available during component initialization.
- The exception prevented TBF from starting and made it impossible to correct the component configuration through the UI.

Solution:

1. Improved missing component handling
   - Replaced fatal exceptions for missing storage components with warning logs.
   - Allowed GciBridge and TBF to continue initialization.

2. Preserved existing behavior
   - Available UniDataStorageReader and UniDataStorageWriter components are still linked as before.
   - Existing GciBridge configurations remain compatible.

3. Increased revision
   - Updated revision to 3.9.3145.107.
2026-09-08 21:59:29 +02:00
marekf 6ef42fcc21 <Feat>: Add optional TestID filtering for repeating XML results, increase revision to 3.9.3145.106
Cause:

- Repeating XML output always included every published meter test.
- The existing TestID/Prüfpunkt configuration was not used to filter generated XML test records.
- A configured TestID could be evaluated in an incorrect repeating test context.

Solution:

1. Added optional test filtering
   - Non-empty TestID values define the tests included in repeating XML output.
   - Multiple configured TestID values act as a whitelist.

2. Preserved existing behavior
   - When no TestID is configured, all published tests are exported as before.
   - Existing configurations remain compatible without migration.

3. Prevented cross-test evaluation
   - Test-dependent items are evaluated only for their matching TestID.
   - Values from one test are no longer reused in another test record.

4. Improved source formatting
   - Reformatted ResultsWriter.cs for easier reading and searching.

5. Increased revision
   - Updated revision to 3.9.3145.106.
2026-09-08 14:11:09 +02:00
marekf d2d41df155 <Fix>: Restore parent UniDataStorageWriter in Previous results editor, increase revision to 3.9.3145.105
Cause:

- Previous results opens the ResultsWriter configuration through GetControl(null).
- The component entity list is therefore unavailable.
- The DropDownList could not display the saved ParentName because it was not present in its Items collection.

Solution:

1. Restored the saved parent writer
   - Adds the configured ParentName to the list when it is not already available.
   - Selects the restored UniDataStorageWriter in parentComboBox.

2. Preserved standard configuration behavior
   - All available UDSW components are still loaded when component entities are provided.
   - Previous results can now display and use the previously configured parent writer.

3. Improved source formatting
   - Removed inappropriate line wrapping from ResultsWriterCfgCtrl.cs.

4. Increased revision
   - Updated revision to 3.9.3145.105.
2026-09-08 13:20:55 +02:00
marekf 6d2477be4a <Feat>: Enable TestID column in ResultsWriter configuration, increase revision to 3.9.3145.104
Cause:

- ResultsWriter explicitly suppressed the existing TestID column.
- Users could not configure the test identifier for test-dependent result variables.
- In the German localization, the corresponding Prüfpunkt column was therefore hidden.

Solution:

1. Enabled TestID configuration
   - Set SupressTestIDColumn to false.
   - The TestID/Prüfpunkt column is now displayed after Merge.

2. Preserved existing configuration handling
   - TestID values continue to use the existing WMeterRsltItemSpec serialization.
   - No configuration format change was required.

3. Increased revision
   - Updated revision to 3.9.3145.104.
2026-09-08 12:54:53 +02:00
marekf 57152ae749 <Feat>: Add XML-based payload archive filename configuration, increase revision to 3.9.3145.103
Cause:

- Payload archive filenames required values from the generated XML payload.
- Date/time values needed filename-safe formatting.
- XML result values such as Passed and Failed needed configurable conversion to P and F.

Solution:

1. Added XML filename tokens
   - Supports any unique non-repeating XML value using {Xml:/path}.
   - Resolves filename values directly from the generated payload.

2. Added user-friendly token configuration
   - Clicking inside a token opens the XML value chooser.
   - Added Time format and Mask transformations.

3. Improved filename generation
   - Validates XML paths and rejects ambiguous repeating values.
   - Sanitizes resolved values for safe filesystem usage.
   - Passes the per-meter payload context from ResultsWriter.

4. Integrated the new dialog
   - Added PayloadFileNameXmlTokenDlg and its Designer file.
   - Updated the TBF project configuration.

5. Increased revision
   - Updated revision to 3.9.3145.103.
2026-09-08 12:52:40 +02:00
michal 88b8bc5534 fix precision correct factor (Mexico), added diff, correction in percentage in Result Configuration 2026-09-07 14:07:07 +02:00
marekf 41408b30da <Feat>: Improve Previous Results layout and resizable result columns, increase revision to 3.9.3145.103
Cause:

- Previous Results used fixed column widths, making long procedure and purchase order values difficult to read.
- Result columns could not be resized interactively.
- Window resizing caused unnecessary UI redraws and visible lag.
- The existing result layout lacked clear column headers and visual separation.

Solution:

1. Added resizable result columns
   - Added draggable column separators.
   - Keeps column widths synchronized across all displayed result rows.
   - Added optimized resize preview to reduce UI lag.

2. Improved responsive layout
   - Enlarged the default Previous Results window.
   - Keeps Purchase Order, OK, NOK and Actions aligned to the right.
   - Uses Procedure as the flexible column when resizing the window.

3. Improved result presentation
   - Added aligned column headers.
   - Added modern column colors and styled action buttons.
   - Reduced spacing between result rows and improved separators.

4. Increased revision
   - Updated revision to 3.9.3145.103.
2026-09-04 08:25:27 +02:00
marekf 136be96e1b <Feat>: Add customer XML structure mapping support in ResultsWriter, increase revision to 3.9.3145.102
Cause:

- The customer XML format requires batch, DUT, group and test-level metadata.
- ResultsWriter did not provide variables for test position, repetition index, batch duration, DUT test duration or aggregated test statuses.
- Missing WaterMeterData could cause a NullReferenceException while evaluating WM Type.

Solution:

1. Added XML mapping variables
   - Added TestPositionInBatch and TestRepetitionNr.
   - Added BatchTime and TestsTotalTime.
   - Added PassedFromAllTests and PassedFromRepeatedTests.

2. Added hierarchical result evaluation
   - Evaluates the overall PANEL/DUT status from all tests.
   - Evaluates GROUP status from repeated instances of the selected test.

3. Improved meter data handling
   - Made WM Type evaluation null-safe when WaterMeterData is unavailable.

4. Increased revision
   - Updated revision to 3.9.3145.102.
2026-09-04 08:20:50 +02:00
michal 0258e54b4e Poseidon integration fix, ReadMe_BugFix.md actualisation 2026-09-03 10:50:20 +02:00
marekf d3c8813012 <Fix>: Correct test-dependent result evaluation in ResultsWriter, increase revision to 3.9.3145.101
Cause:

- ResultsWriter evaluated selected test-dependent items without the actual TestID.
- This caused values such as Test passed(), timestamps, flow, pressure, temperature, conductivity and error data to be empty or incorrect.

Solution:

1. Fixed test-aware result evaluation
   - Uses published regular meter test results.
   - Passes mtr.Name() as TestID to item.Print(wm, testId).

2. Restored correct test result mapping
   - Test-dependent values are now resolved from the correct TestRslt / MeterTestRslt.

3. Increased revision
   - Updated revision to 3.9.3145.101.
2026-09-03 10:00:40 +02:00
michal b8e54e1fc9 Poseidon - merge project 2026-09-02 16:18:21 +02:00
marekf 054075a341 <Feat>: Add XML result generation with file and MSSQL output support, increase revision to 3.9.3145.100
Cause:

- ResultsWriter required a generic way to generate customer-specific XML result data from TBF measurement results.
- The customer reference XML contains example runtime values and repeated result structures, so it cannot be used directly as the generated output.
- TBF result variables must be explicitly mapped to destinations in the customer XML structure.
- The generated XML result data must support two output targets:
  - direct creation of an XML file,
  - delivery of the XML payload to a Microsoft SQL stored procedure.
- Preview generation must allow the XML structure and configured mappings to be verified without executing the production database write.
- Increase revision to 3.9.3145.100.

Solution:

1. Added XML reference analysis
   - Creates a clean base XML structure.
   - Extracts the repeating result prototype.
   - Prevents sample runtime values from the customer reference XML from leaking into generated results.
2. Added configurable TBF-to-XML result mapping
   - Allows explicit mapping of TBF result variables to customer XML destinations.
   - Supports one-time and repeating XML destinations.
   - Keeps the mapping independent of the semantic meaning of customer XML attribute names.
3. Added XML destination viewer and configurator
   - Shows the current mapping.
   - Highlights repeating destinations.
   - Identifies already used one-time destinations.
4. Added runtime XML result generation
   - Uses the configured TBF-to-XML mappings.
   - Uses measurement procedure result data.
   - Builds the output from the clean base XML and repeating XML prototype.
   - Generates repeated result records according to the executed measurement procedure.
5. Added simulation-based Preview request
   - Generates a complete XML payload using simulation values.
   - Allows XML structure and mapping verification before production execution.
   - Does not execute the production stored procedure.
6. Added direct XML file output support to UniDataStorageWriter
   - Supports File / .xml as a physical output target.
   - Creates the generated XML result file in the configured output directory.
7. Added Microsoft SQL stored-procedure XML output
   - Supports Microsoft SQL / StoredProcedure as a physical output target.
   - Passes the generated XML payload through the configured stored procedure parameter.
8. Added optional XML payload archiving
   - Allows generated XML payloads to be stored in the configured Payload archive.
   - Can be used together with the Microsoft SQL stored-procedure output.
9. Kept ResultsWriter independent of the physical output target
   - ResultsWriter generates the result payload.
   - UniDataStorageWriter decides how and where the payload is physically written.
   - The same ResultsWriter XML generation mechanism is therefore used for both XML file and MSSQL outputs.
10. Increased revision
   - Updated revision to 3.9.3145.100.
2026-09-02 12:05:10 +02:00
michal 8d42232589 Poseidon move from feature/morisville/fix_cli_timeout 2026-09-01 10:27:04 +02:00
michal e4d4d75642 feat(ally): add ASIC-style designer configuration and manual test controls 2026-09-01 09:00:12 +02:00
michal 2b5a0ffe14 Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode_ALLY' into develop/SLM-PT50_genesisDirectDecode_ALLY 2026-08-25 14:35:13 +02:00
marekf a0d53f9ec9 <Fix>: RefPulses carry-over by restoring testInProgress behavior in StandingStart, increase revision to 3.9.3145
Cause:
1. Background: Restore/ensure testInProgress behavior before the DataEntry sequence and explicitly prevent to reset the pulse.
2. Increase revision to 3.9.3145

Solution:
1. Deleted .AddOperation(testInProgress) calling
2. Increased revision to 3.9.3145
2026-08-25 13:49:49 +02:00
michal dfa8693be9 Added table columns TestRslt -> ConductMean, .... 2026-08-25 10:38:08 +02:00
michal 8157a752bd Ally multy reg readers implementation in SmartCommunicationForm.cs 2026-08-25 10:26:35 +02:00
michal 4dd805bb1c Ally multy reg readers implementation in SmartCommunicationForm.cs 2026-08-25 10:26:15 +02:00
marekf 1e45f48c75 <Update>: Version to 3.9.3144.0 in AssemblyInfo files 2026-08-25 08:23:27 +02:00
marekf d833eca584 <Merge_Fix>: System.Data.SQLite, System.Data.SQLite.Core, Stub.System.Data.SQLite.Core.NetFramework 2026-08-24 15:36:50 +02:00
marekf c966a7034c <Merge-Fix>: Solve merge conflicts 2026-08-24 15:04:11 +02:00
marekf f051d51ae0 <Fix>: Incorrect cycle resume behavior after Stop and Start, increase revision to 3.9.3134.114
Cause:
1. When the Cycle was stopped during the second or a later test and then resumed using the Start Test button, the resume confirmation was handled incorrectly. After selecting to continue, the sequence restarted from the first test instead of continuing from the interrupted test.
2. Increase revision to 3.9.3134.114

Solution:
1. Corrected the Cycle resume logic so that, after confirming continuation, the sequence resumes from the interrupted test instead of restarting from the first test.
2. Increased revision to 3.9.3134.114
2026-08-24 14:25:19 +02:00
marekf 267159e0a9 <Fix>: RefPulses carry-over by restoring testInProgress behavior in StandingStart, increase revision to 3.9.3134.113
Cause:
1. Background: there was a suspicion that the Bukoven board left RefPulses active across operations; this was investigated and ruled out. The pulse counter is reset by testInProgress when an operation is reused. During the third DataEntry window testInProgress had been temporarily disabled (SLM vs Karlsruhe difference), which allowed RefPulses to appear to persist.
2. Increase revision to 3.9.3134.113

Solution:
1. Restore/ensure testInProgress behavior during the DataEntry sequence and explicitly reset the pulse counter when starting a new operation.
2. Increased revision to 3.9.3134.113
2026-08-24 12:54:15 +02:00
michal 26db172153 Camera WM Purchase Order - crop disabled 2026-08-24 12:21:49 +02:00
michal 2e75f65b4a Update version to 3.9.3142.0 in AssemblyInfo files 2026-08-20 00:27:39 +02:00
michal 432cb91e5a Update Flip Mode handling and introduce SetTestModeOpto7Str alias
Refactor Flip Mode parameter type in `WMeterRsltItemSpec` to `Quantity.String` for consistency. Add `SetTestModeOpto7Str` alias to improve readability and replace legacy A0 test mode reference in `iPerlCommunicationParams`.
2026-08-20 00:27:06 +02:00
michal b0083afa10 DataEntry.UNI - timeout, autoclose improve
Introduce configurable timeouts for data entry volume reads in `IRegReaderSmart` and its implementations: added optional timeout parameters and updated default values across associated forms and methods. Updated `EntryFormCfg` to support customizable timeout settings.
2026-08-19 23:47:50 +02:00
michal 955b59a195 Improve UNI Data Entry auto close
Add tooltip functionality for parameter names in `ComponentCfgCtrl` and auto-close countdown improvements in UNI Data Entry forms
2026-08-19 22:32:14 +02:00
michal b904d0ca41 Fix Flip Mode - ver. 3.9.3141.0
Add robust handling for form closure in UNI Data Entry: prevent operations on disposed/closing forms, enhance logging, and update logic in serial number and volume updates. Increment version to 3.9.3141.0.
2026-08-19 19:13:41 +02:00
michal f34046df2a Update version to 3.9.3140.0 in AssemblyInfo files - FIX DataEntry.UNI 2026-08-19 14:49:24 +02:00
michal 889782068e Added counter to OK button, 5 sec default now
Add auto-close countdown timer for UNI data entry forms: implement timer logic, UI updates, and early exit handling
2026-08-19 14:47:34 +02:00
michal d12ee008db FIX UNI Data Entry - Smart Reader + missing files
Implement smart meter interface enhancements for AllyReader: Add `ISmartMeterReader` interface, update `RegisterReaderSelection` logic, integrate smart-meter position selection, and expand unit test coverage.
2026-08-19 14:33:06 +02:00
michal 6c3c6cd0ef FIX UNI Data Entry - corrensponded with iPerlCommunicationForm.cs
Add debug logging and UI enhancements for data entry processes: Improve register reader handling in sequences and forms, add detailed data entry debug logs, integrate serial number and volume watermarking, and update localized strings in multiple languages.
2026-08-19 13:18:34 +02:00
michal 5803f06bdb Flip mode related to test result - DB column in MeterTestRslt, support back compability
Add Flip Mode support across iPerl-related test methods and database schema: implement FlipMode property, update MeterTestRslt mappings, integrate schema migration logic, and refine test result handling.
2026-08-19 11:52:46 +02:00
michal a4acf30771 Refactor FlipMode enum and update references: rename DisabledConstant to Constant and EnabledRandomized to Randomized across codebase, including unit tests and integration tests, for improved readability and consistency. 2026-08-19 10:47:45 +02:00
michal a4ef208233 Fix ver. 3.9.3139 iPerlCommunicationForm.cs problems + exceptions if another regreadrer has mistakely same ports
Enhance iPerl dialog layout and error handling: improve `ShuffleTextBoxes` with positional mapping, refine checkbox state tracking, add detailed logging for labels and checkboxes, and handle serial port exceptions. Increment version to 3.9.3139.0.
2026-08-18 16:09:21 +02:00
michal be6b40b5cd Fix Optical heads ASIC iPerl dialog manual test communication 2026-08-18 14:05:33 +02:00
michal 8738edd0c5 Added FLIP MODE Constant, Randomised
Add support for Flip Mode configuration in iPerl: Implement `SetFlipMode` functionality in `OptoHeadTest` and `RadioService`, integrate constants, enhance UI, and add unit and integration tests for constant/randomized flip mode settings.
2026-08-18 13:59:59 +02:00
michal c71fe75446 Ally iPerl initial - reader,test method, unit test
Add AllyReader and AllyCalibration support with tests: Introduce new register readers, calibration methods, and comprehensive unit tests for integration and functionality validation. Update project files accordingly.
2026-08-18 10:01:02 +02:00
michal c619c7d3b8 Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode 2026-08-17 10:27:57 +02:00
michal f3e5527145 ver. 3.9.3138.0 - OPTHO FORMATING improve (ASIC,genesis) 2026-08-17 10:27:10 +02:00
michal 39941842d4 OPTHO FORMATING improve (ASIC,genesis)
Enhance iPerlHat protocol logging and error handling: add optical HEX formatting, improve diagnostic messages, and extend test command descriptions.
2026-08-17 10:25:35 +02:00
michal 3488939995 FIX iPerl ASIC meter - mexico
Update MultiplyFactor constant to 1 and increment version to 3.9.3137.0
2026-08-14 14:14:33 +02:00
michal 0f2ef5a5bf bugfix IPERL_ASIC conductivity
update mappings , version 3.9.3136.0
2026-08-13 15:16:58 +02:00
michal 55d2381e8a Mexico - read additional parameters and store to DB, ver. 3.9.3135.0
Add support for reading and handling additional common parameters in OptoHeadTest. Extend RadioService and related classes with enhanced parsing and validation logic. Update UI and constants for functionality integration.
2026-08-12 16:20:16 +02:00
michal 126322584f Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode 2026-08-05 12:48:48 +02:00
michal 4d9ddef3ca IperlASIC - added aditional parameters
Add support for reading additional common parameters in OptoHeadTest. Enhance `RadioService` and `VersionTypeResult` with new parsing logic. Update related constants and UI elements for functionality integration.
2026-08-05 10:57:34 +02:00
marekf 7139cdbe80 Merge branch 'develop/SLM-PT50-7-2026-merged-smart-cam-slm-mex' into develop/SLM-PT50_genesisDirectDecode 2026-08-04 16:31:57 +02:00
marekf 93d7456ccd <Fix>: RefPulses carry-over by restoring testInProgress behavior in StandingStartMassCollection, increase revision to 3.9.3134.112
Cause:
1. Background: there was a suspicion that the Bukoven board left RefPulses active across operations; this was investigated and ruled out. The pulse counter is reset by testInProgress when an operation is reused. During the third DataEntry window testInProgress had been temporarily disabled (SLM vs Karlsruhe difference), which allowed RefPulses to appear to persist.
2. Increase revision to 3.9.3134.112

Solution:
1. Restore/ensure testInProgress behavior during the DataEntry sequence and explicitly reset the pulse counter when starting a new operation.
2. Increased revision to 3.9.3134.112
2026-08-04 16:21:33 +02:00
michal 7a8ce7b6ab IperlASIC - Improved and added tests, hardware integtration tests works
Improve `VersionTypeResult` parsing and handling: Add compact/legacy payload support. Extend `ReadingUnits`. Update `IperlHatIntegrationTests` and `RadioService` with new tests and functionality integration.
2026-08-04 11:53:47 +02:00
michal 865528e344 iPerlASIC - additional parameters.
Add protocolCommons classes and enhance RadioService with support for CalibrationFactor, VersionType, ReadingUnits, and FlipMode operations. Add corresponding unit tests for validation. Update project files.
2026-08-03 15:42:16 +02:00
michal 02bb9ee9fa Update RadioService: Replace IsLoggedOn with IsConnected condition checks 2026-07-31 14:09:10 +02:00
marekf 79de40515a Upgrade: Deleted LANG_PL compilation condition, disabled legalizator before test, and version to 3.9.3134.111
Cause:
1. Unnecessary and mandatory user verification before the test, in addition, a bug appears: the "Approval by legalizer" window is displayed behind the main application window. The window was only needed for the Polish project.
2. `LANG_PL` constant in `TBF.csproj` was no longer needed.
3. Assembly version and file version in `AssemblyInfo.cs` needed to be incremented to `3.9.3134.111`.

Solution:
1. Made `altProcNameLabel` and `altProcNameTextBox` always visible and disabled specific UI controls in `ProcedureDlg.cs`.
2. Removed `LANG_PL` from `DefineConstants` in `TBF.csproj`.
3. Updated assembly version and file version in `AssemblyInfo.cs` to `3.9.3134.111`.
2026-07-28 11:49:37 +02:00
marekf e38c6c1199 Upgrade: Add remaining time display for tests, version 3.9.3134.110
Cause:
1. Missing functionality to display remaining time during tests in `StandingStartMassCollectionSeq.cs` and `StandingStartMassCollectionAdvanceSeq.cs`.
2. Assembly version and file version required an update to reflect changes.

Solution:
1. Implemented remaining time display in `StandingStartMassCollectionSeq.cs` and `StandingStartMassCollectionAdvanceSeq.cs` using `Bridge.OnActivity` to show time in minutes and seconds or seconds only.
2. Updated assembly version and file version in `AssemblyInfo.cs` to `3.9.3134.110`.
2026-07-28 11:32:53 +02:00
marekf dbb35a203e Update: Adjust input unit constants in DataEntry form and increment version to 3.9.3134.109
Cause:
1. Updated `unit` constant in `TestStartEndForm` class within `TBF.Rig.DataEntry.StandardCamera` namespace from `Unit.m3` to `Unit.l`.
2. Updated `unit` constant in `TestStartEndForm` class within `TBF.Rig.DataEntry.StandartCameraPurchaseOrder` namespace from `Unit.m3` to `Unit.l`.
3. Incremented assembly version and file version in `AssemblyInfo.cs` to `3.9.3134.109`.

Solution:
1. Changed `unit` constant in `TestStartEndForm` class within `TBF.Rig.DataEntry.StandardCamera` namespace to `Unit.l`.
2. Changed `unit` constant in `TestStartEndForm` class within `TBF.Rig.DataEntry.StandartCameraPurchaseOrder` namespace to `Unit.l`.
3. Updated assembly version and file version in `AssemblyInfo.cs` to `3.9.3134.109`.
2026-07-28 07:38:30 +02:00
marekf a88a094e86 Release SLM-PT50 3.9.3134.108, increase revision after merge 2026-07-23 13:08:52 +02:00
marekf ffaebbdf07 Merge branch 'develop/SLM-PT50_genesisDirectDecode' of http://87.197.120.129:33300/michal/tbf into develop/SLM-PT50 2026-07-23 12:57:20 +02:00
michal e7d04b55b3 Live Stream Operations: Add StartLiveStream to CJMS11 camera 2026-07-22 10:02:22 +02:00
michal 8301971906 Fix StartEndForm in StandartCameraPurchaseOrder layout and positioning, remove Scroll Bar 2026-07-21 16:03:43 +02:00
michal 693cf7e4e2 Refactor TestStartEndForm - Remove unused methods and comments, simplify image grouping logic. 2026-07-21 15:22:50 +02:00
michal 2fa212e6ff FIX CAMERA - Improve error handling, modularize image processing functions for CJMS11 cameras, and enhance multi-image support in TestStartEndForm. 2026-07-21 14:50:59 +02:00
marekf a210a0d1f2 Upgrade (UniDataStorageWriter): improve writer configuration UX and CSV handling
- added technology-specific default configuration for new writers
- auto-fill default SQL/XLSX write templates
- disabled write templates for CSV technology
- added technology-specific data source hints
- changed test parameter format to Column=Value and Where=Value;Set=Value
- improved parameter validation to prevent invalid input crashes
- added automatic CSV header creation and header validation
- aligned CSV writer behaviour with XLSX writer
- Increase revision number
2026-07-21 11:18:11 +02:00
marekf 4cd191fcb2 Merge branch 'develop/SLM-PT50-7-2026-merged-smart-cam-slm-mex' into develop/Mexico-6-2026 2026-07-20 15:54:01 +02:00
marekf e21833fb5f Release Mexico 3.9.3069.1 2026-07-20 15:47:06 +02:00
marekf b746ceb34a Upgrade - Replace PulsesTypeByQuantity with MultiFunctionalVariables unit filtering based on RegisterReader quantity type - remove PulsesTypeByQuantity-based parameter values
- generate available units using Units.IsQuantity(...)
- use Quantity.MultiFunctionalVariables to populate supported units
- centralize unit selection through Units.GetQuantity()
2026-07-20 14:09:29 +02:00
marekf 83c1f0e817 Update - Actualized revision nr. 2026-07-17 14:15:22 +02:00
marekf a88a5a8db2 Fix - 1. StandingStartMassCollection and StandingStartMassCollectionAdvance - changed all delayed Activity strings, 2. Added UI/Bridge onDelayedActivity() method for universal using 2026-07-17 14:15:04 +02:00
marekf 271200a8da Upgrade - StandingStartMassCollectionAdvance method - 1. changed structure and residual flow delays by changes in StandingStartMassCollection method, 2. added variables, counting and evaluation for volume/mass type of RegisterReader 2026-07-17 12:42:07 +02:00
marekf b703297f5e Fix - 1. repaired StandingStartMassCollection MassEN evaluation, the problem was caused by the end scale measuring only after recalculating the basic values - 2. removed fixed delay for the first diverter switching and first diverter switching was moved after a configurable delay - 3. hidden unitComboBox in the StartEnd dialog of the DataEntry.Standard24 component, because units are now defined using the RegisterReader component 2026-07-17 09:55:03 +02:00
marekf 637d1d021d Fix - StandingMassCollection method - add end mass measurement 2026-07-16 15:19:28 +02:00
marekf dbe424b17a Add - StandingStart method - Store and log default PumpPower for dynamic test repetitions - Read PumpPower from the current pump before starting dynamic tests.
- Store the value as the default PumpPower for subsequent test instances in the cycle.
- Add logging when PumpPower is initialized from the pump.
- Add logging at test start including test name, repetition number,
  last repetition flag, and PumpPower to improve diagnostics.
2026-07-16 14:21:00 +02:00
marekf be0525a319 Upgrade - improved StandingStart method by SLM requirements, added fixed delays for meters stabilization 2026-07-16 13:29:42 +02:00
marekf 0ce130f0ef Fix - repaired merging compatibility problem of GCI return type GciConnectResult - IsLoggedOn and IsConnected, increased VisualStudio version from 17.8 to 18.5 2026-07-16 12:37:59 +02:00
michal c1ee29cd06 Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode 2026-07-16 12:28:36 +02:00
michal 28607e2729 fix Strings - Camera CJMS11 - support dialog multi pictures 2026-07-16 12:28:28 +02:00
michal f1bc71fb92 Camera CJMS11 - support dialog multi pictures 2026-07-16 12:19:27 +02:00
michal 69b607f963 Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode
# Conflicts:
#	TBF/TBF.csproj
2026-07-16 10:28:15 +02:00
marekf 6ac3ea87ef Upgrade - improved StandingStartMassCollection method by SLM requirements, added fixed delays, added residual flow delays 2026-07-16 09:30:59 +02:00
marekf 38973e0030 Add - Store and log default PumpPower for dynamic test repetitions - Read PumpPower from the current pump before starting dynamic tests.
- Store the value as the default PumpPower for subsequent test instances in the cycle.
- Add logging when PumpPower is initialized from the pump.
- Add logging at test start including test name, repetition number,
  last repetition flag, and PumpPower to improve diagnostics.
2026-07-15 11:35:32 +02:00
marekf 37c89a4c9c Fix - missing safe shutdown when PerformSteps returns UiCmdStop
- When STOP is pressed during PerformSteps() in the BeforeTest transition,
Transition() returned immediately and skipped the common shutdown logic.
This caused FM pumps and valves to remain in their previous state.
- Perform the required safe shutdown (FM pump off and default valve setup)
before returning UiCmdStop or Error.
2026-07-14 14:41:53 +02:00
marekf 0075362f92 Fix - Handle scale underload condition
- Added Underload measurement state
- Detect underload responses from Mettler Toledo scales
- Automatically zero the scale after underload detection
- Restart mass measurement after successful zeroing
- Prevent zeroing response from being used as a valid measurement
- Preserve measurement stability by clearing buffered readings after underload
2026-07-13 14:01:57 +02:00
marekf 38d28599ad Merge branch 'develop/SLM-PT50_genesisDirectDecode' of http://87.197.120.129:33300/michal/tbf into develop/SLM-PT50 2026-07-03 13:37:26 +02:00
marekf c9a4b0f3ce Add (develop) - component ResultsWriter - added diag + english comments 2026-07-03 13:35:39 +02:00
marekf b74f1fd644 Add (develop) - first succesfull test - new component ResultsWriter - note: IResultsProcessor type componet, store result variables to database by using of component UniDataStorageWriter to the user-configured storage. The selection of variables is done using the standard UI for selecting the display of measurement results . In other words: The measurement results selected by the user are saved to a user-defined storage. 2026-07-03 12:46:56 +02:00
michal 26b7aa7e8b correction atempt MultiplyFactor for timestamp, volume calculation, 2026-07-02 23:53:15 +02:00
michal 92f63e744d fix INIT - Overload time fix for OptoTelegramRawTest 2026-07-02 23:24:00 +02:00
michal b0581d81ef Extend measurement window for low-flow tests 2026-07-02 23:08:28 +02:00
michal 540b9af871 Overload time fix for OptoTelegramRawTest 2026-07-02 22:32:19 +02:00
michal d11f7107fe fix time calculation from raw data 2026-07-02 21:49:01 +02:00
michal 3c5a28f69d changed LED state from 4 to 7 in 2026-07-02 21:47:14 +02:00
marekf 110b880304 Add (release) new component Modbus.WaterAnalyzerUni derived from original component Modbus.WaterAnalyzer. New component is expanded by the possibility to choose conductivity reading directly from the sensor (Modbus protocol) (original solution) or using a 4-20mA converter to serial line (RS232/485) (Modbus protocol). 2026-07-02 09:01:00 +02:00
marekf 7867044c0a Add (develop) new component ConductivityMeter, because we have papouch AD4RS converter (4-20mA to modbus) - first correct version for testing 2026-07-01 15:58:36 +02:00
marekf 88903f3dac Merge branch 'feature/task/Cordonel-preadjustmentUI-GenesisMeter-ZeroFlowGenesisMeter' into develop/UnionTown 2026-06-12 10:44:51 +02:00
marekf 4e223549ee Develop - GciBridge -> GCI -> PreadjustmentUI functions 7 - successful processes - testbench is exported to UnionTown - without CalibParams DB writer 2026-06-12 10:43:34 +02:00
marekf 2ea0df8faf Develop - GciBridge -> GCI -> create database core in GCI - SkeletoKey - CalibParams - first ok 2026-06-09 19:55:36 +02:00
marekf 061e85ca6b Develop - GciBridge -> GCI -> PreadjustmentUI functions 6 - first successful processes - without CalibParams DB reader and CalibParams DB writer 2026-06-09 08:53:54 +02:00
marekf 269e650b38 Merge branch 'feature/task/SWDocumentation-DocFX' into develop/UnionTown 2026-06-08 10:29:04 +02:00
marekf a3bfc7a43e Develop - GciBridge -> GCI -> PreadjustmentUI functions 5 2026-06-05 15:21:18 +02:00
marekf c2ff40d816 Develop - GCI - create documentation model 2, using DocFX tool - using .md files - output as html page 2026-06-02 07:26:36 +02:00
marekf eb09ae2eca Develop - GCI - create documentation model, using DocFX tool - using .md files - output as html page 2026-05-29 09:49:28 +02:00
marekf d1b6247bb7 Develop - GciBridge -> GCI -> create database core in GCI - SkeletoKey - CalibParams 2026-05-29 09:43:51 +02:00
marekf c5f52e06fa Develop - GciBridge -> GCI -> PreadjustmentUI functions 4 2026-05-26 10:51:18 +02:00
marekf 9700ba7900 Develop - GciBridge -> GCI -> PreadjustmentUI functions 3 2026-05-22 08:52:40 +02:00
marekf bc72130d09 Develop - GciBridge -> GCI -> PreadjustmentUI functions 2 2026-05-21 08:16:02 +02:00
marekf ad208f9633 Develop - GciBridge -> GCI -> PreadjustmentUI functions 2026-05-18 19:20:10 +02:00
marekf ad2bfd3639 Upgrade (develop) - GCI - GciBridge - improved Disconnect 2026-05-14 13:05:21 +02:00
marekf 5e637ae02e Upgrade (develop) - GCI - GciBridge - full parallel threading slots actions 2026-05-13 09:30:27 +02:00
marekf 63f8dd7467 Upgrade (develop) - GCI - GciBridge - InitSlot() - only ports config update if slot already exists 2026-05-12 14:59:15 +02:00
marekf aac3af8714 Upgrade (develop) - GCI - GciBridge - delete meter.Logout() in GetPcbId() 2026-05-12 14:20:24 +02:00
marekf 378917f59d Upgrade (develop) - GCI - GciBridge - GCI-Laatzen interface debugging 2026-05-12 13:30:21 +02:00
marekf 76e7ccb4a6 Update (develop) - GCI - GciBridge - better return for Connect 2026-05-11 17:14:56 +02:00
marekf 953b02a6e8 Upgrade (develop) - GCI - GciBridge - new CleanSlot() - Disconnect Hard Dispose 2026-05-08 11:49:14 +02:00
marekf 71a66dca2d File modified due to the need for MF to compile in advance, but the change is ultimately not necessary for either MF or MB 2026-05-07 18:23:50 +02:00
marekf 978c620287 Update (develop) - GCI - GciBridge - improved PublicModels - fixed bugs 2026-05-07 18:20:18 +02:00
marekf 8489dafdf7 Update (develop) - GCI - GciBridge - progress 2026-05-06 14:58:44 +02:00
michal cfc52f195b Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode
# Conflicts:
#	TBF/TBF.csproj
2026-05-06 10:26:15 +02:00
michal 68a1eb9941 Update project references and paths to replace project dependencies with direct DLL references. Standardize formatting in GenesisImplHeadTestCtrl and refine Operations enum declarations. 2026-05-06 10:24:33 +02:00
marekf c1573390b5 Merge branch 'develop/UnionTown' into develop/SLM-PT50 2026-05-06 09:08:09 +02:00
marekf 5d60523e87 Fixed - next issue with old Newtonsoft.Json v 12.0 - updated to 13.0 2026-05-06 07:38:49 +02:00
marekf 91c63e0792 Fixed - bad copying GenesisCordonelInterface runtime files to TBF target folder 2026-05-06 07:35:17 +02:00
marekf 0940df2f1a Fixed - issue with old Newtonsoft.Json v 12.0 - updated to 13.0 2026-05-06 07:32:55 +02:00
michal 16a76720b8 Update references and paths for Xylem.Common components, refine OptoHeadTest handling for connection requests, and increment assembly version to 3.9.3063.1. 2026-05-05 08:34:21 +02:00
marekf 7101fd679e Merge branch 'develop/UnionTown' into develop/SLM-PT50 2026-05-04 15:45:07 +02:00
marekf 86299da682 Fixed - bad runtime files copying in postbuilding of GenesisCordonelInterface project. Copying is replaced from TBF/Build/ to GCI/Build 2026-05-04 15:40:05 +02:00
marekf 39b951b709 Merge branch 'develop/UnionTown' into develop/SLM-PT50 2026-05-04 13:08:10 +02:00
marekf a475bd80f3 Change - ExternalProjects folder to gitignore 2026-05-04 13:07:28 +02:00
marekf 4e64bcd117 Merged branch Uniontown - GenesisCordonelInterface + GciBridge 2026-05-04 12:49:02 +02:00
marekf fbd0219a4a Update (develop) GCI - GciBridge - big change - for implement to GenesisHead and SmartReader 2026-05-04 11:29:13 +02:00
michal 104a68d9dc Remove unused System.IO.Ports, Common, Config, and other redundant namespaces. Update NuGet package configurations to reflect new paths and tools. 2026-04-29 09:51:05 +02:00
michal 33a5e479a9 Refactor RadioService to improve asynchronous handling, replace legacy code with CommInterfaceBridge, and standardize methods for GenesisHead communication. Remove unused GenesisCommunication components and increment assembly version to 3.9.3062.1. 2026-04-28 16:26:26 +02:00
michal 5482d4ac96 Merge remote-tracking branch 'private-origin/develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode
# Conflicts:
#	TBF/Rig/TestMethods/GenesisCommunication/GenesisHead/GenesisHead.cs
#	TBF/TBF.csproj
2026-04-28 07:51:09 +02:00
michal 0d984a77b3 Refactor RadioService to utilize GciBridge for communication, replace SerialDriver, and add SlotNr support in Genesis configuration and UI. 2026-04-28 07:08:53 +02:00
marekf 7e95e18207 Fixed - genesis library path issue 2026-04-27 16:52:50 +02:00
marekf 38fa86d243 Merge branch 'develop/UnionTown' into develop/SLM-PT50 2026-04-27 16:42:47 +02:00
marekf 4c1ce73de9 Upgrade (develop) - GCI - GciBridge - big change 2026-04-27 16:40:42 +02:00
michal eea80d39c0 Remove GenesisCommunication test methods and components:
- Deleted `CalibrationStruct`, `ConfigStruct`, `Enums`, `Factory`, `GenesisHead`, and related files.
2026-04-27 10:48:27 +02:00
marekf 15dc325275 Upgrade (develop) - GCI - big change 2026-04-27 07:57:16 +02:00
marekf ca333d1772 Upgrade (develop) - GCI UI for TBF - change Forms to Views 2026-04-26 11:40:21 +02:00
marekf a4ece06b05 Upgrade (develop) - GCI UI for TBF - change Forms to Views 2026-04-26 11:39:35 +02:00
marekf 992452052e Upgrade GenesisCommunication - after adding GCI functionality to xylem DLL's updater, adding PortCore DLL is needed 2026-04-26 09:32:30 +02:00
marekf 75192bbd09 Add (develop) GCI - new functionality - xylem DLL's updater for TBF - actualize DLL's in TBF.packages.common of TBF project path - fixed problem witch multiple referencing of GenesisCommunication and GciBridge on one DLL but with difference version 2026-04-26 08:13:43 +02:00
marekf 6199bd48c5 Upgrade .NET Framework 4.7.2 to 4.8 for Laatzen + GCI + TBF compatibility 2026-04-24 13:00:53 +02:00
marekf 25434d70d4 Merge branch 'feature/task/Cordonel-communiation-tests' into develop/SLM-PT50 2026-04-23 10:00:59 +02:00
michal de6dd45dcb Fix Flow - Increment assembly version to 3.9.3059.1. 2026-04-23 09:56:32 +02:00
marekf 74f2e99ed3 Merge branch 'bugfix/Flow-meter-in-parallel-reverse-bug' into develop/SLM-PT50 2026-04-23 09:43:39 +02:00
marekf 99b1f4a171 Fixed FlowMetersInParallel - incorrect ltrPerPulse counting from average value of nominalFreq 2026-04-23 09:40:05 +02:00
marekf 8c10aa3752 Add (develop) GCI - GciBridge 2026-04-23 09:09:27 +02:00
michal 7170da4a70 Add GenesisCommunication test methods and related components:
- Introduce `TestMethod`, `SequenceConditionOp`, and `Factory` for `GenesisCommunication`.
- Add `TestMethodCfgCtrl` and its designer for test configuration UI.
- Update `.csproj` to include new files.
2026-04-22 10:18:42 +02:00
michal 842f009b42 Increment assembly version to 3.9.3058.1 and fix logging format issue in FlowMeter initialization. 2026-04-21 07:43:35 +02:00
michal 7f30ca0cd1 Merge branch 'develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode_morisville
# Conflicts:
#	TBF/Properties/AssemblyInfo.cs
#	TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs
2026-04-20 14:25:13 +02:00
michal 93e207c211 Update GenesisSmartReader for refined start/end marker logic, add _endDeltaSeconds property, and improve telegram index resolution methods. Increment assembly version to 3.9.3031.1. 2026-04-20 13:25:25 +02:00
marekf 64cafc088a Merge branch 'bugfix/Flow-meter-in-parallel-reverse-bug' into develop/SLM-PT50 2026-04-20 12:45:25 +02:00
marekf 8a0da27a07 Fixed RegValve + FlowMetersInParallel - incorrect NominalFreq sum 2026-04-20 12:39:51 +02:00
michal 5a8478e782 Refactor GenesisSmartReader Q3 calibration tests and logic:
- Expand Q3 calibration tests with diverse scenarios in `GenesisSmartReader_Q3Test`.
- Introduce channel-specific validation for calibration tests.
- Adjust methods for Q3 calibration in `GenesisSmartReader` to support per-channel factors.
- Add utilities for preparing simulation data and refinements for test consistency.
- Update `CliRunner` with improved task management, timeout handling, and logging enhancements.
2026-04-17 16:05:16 +02:00
marekf 368cd95114 Bug (fixing) RegValve OK, FlowMeterInParallel NOK 2026-04-15 10:50:27 +02:00
michal 33ef914984 Update GenesisReaderTests: add real input parsing, format variation handling, and rollover cases; remove outdated Q3 calibration tests; increment version to 3.9.3056.1 2026-04-15 09:56:54 +02:00
michal 3eb0b87f0d Add Q3 calibration tests for GenesisSmartReader and refactor test cases:
- Introduce new `GenesisSmartReader_Q3Test` class with comprehensive Q3 calibration scenarios.
- Refactor existing tests to utilize simulation data for better consistency and validation.
- Adjust Q3 calibration logic in `GenesisSmartReader` to enhance calculation accuracy and validation criteria.
2026-04-15 09:22:09 +02:00
marekf c13cb725f0 Merged branch > UniDataStorageWriter-and-UniDataStorageReader 2026-04-15 09:13:57 +02:00
marekf c6d4a016b5 Add (develop) GCI - interface of GCI and Laatzen - GciBridge component 2026-04-15 08:46:19 +02:00
marekf eda0644b4b Add (develop) GCI - interface of GCI and Laatzen 2026-04-15 08:41:27 +02:00
michal 711dfc03ef Fix Q3 calibration logic in GenesisSmartReader: replace _rawStartEndByChannel with recalculatedVariablesByChannel for accurate data computation. 2026-04-14 15:54:28 +02:00
michal 93459ccfab Refactor water meter handling in SequenceBase and FlyingStartMassCollectionSeq:
- Enhance logic for enabling/disabling channels based on water meter data.
- Introduce Q3 calibration validation in `GenesisSmartReader` with configurable thresholds.
- Update `GenesisCfgCtrl` UI to disable certain inputs.
2026-04-14 15:41:13 +02:00
marekf 5b73835d94 Add (develop) GCI - interface of GCI and Laatzen 2026-04-14 12:33:06 +02:00
michal 009aefb7c9 Refactor GenesisSmartReader and SequenceBase logic, enhance channel handling in water meters, and update GUI components:
- Adjust `Disabled` logic for water meters in `SequenceBase` allowing conditional enabling of channels based on serial number.
- Introduce `EnableShowChanels` property in `GenesisSmartReader` and integrate into `FlyingStartMassCollectionSeq`.
- Modify `StartupFlushMs` to derive configuration dynamically.
- Update `GenesisCfgCtrl` with a checkbox for enabling channels and input for flush timing.
- Increment assembly version to `3.9.3054.1`.
2026-04-14 08:03:02 +02:00
michal d2e18d615d Bump assembly version to 3.9.3053.1. 2026-04-13 14:17:56 +02:00
michal 69b475eb77 Refactor GenesisSmartReader for improved simulation and testing:
- Add `PrepareCalculatedChannelDataSimulationForTest` and supporting utility methods for generating and cloning test data.
- Update `StartupFlushMs` and sampling intervals for increased flexibility.
- Revise water meter handling logic in `FlyingStartMassCollectionSeq` to support multiple channels.
2026-04-13 14:17:34 +02:00
marekf 9848b97082 Update (develop) UniDataStorageWriter - first successful version 2026-04-13 12:21:52 +02:00
marekf 0b429ffbc2 Merge branch UniDataStorageReader 2026-04-12 10:53:53 +02:00
marekf ef146efaf0 Merge branch UniDataStorageWriter 2026-04-12 10:49:16 +02:00
marekf 431061a685 Add (developing) UniDataStorageWriter 2026-04-12 02:38:58 +02:00
marekf b6edd9c0a0 Add (developing) UniDataStoreWriter 2026-04-12 02:37:14 +02:00
michal 2210bb8240 Enhance FlyingStartMassCollectionSeq with GenesisSmartReader support; add water meter handling logic and bump assembly version to 3.9.3050.1. 2026-04-11 21:55:34 +02:00
marekf 8d7c1adf37 Update (developing) UniDataStorageReader 2026-04-11 20:49:11 +02:00
marekf 3376ac41b4 Merge branch 'develop/SLM-PT50_genesisDirectDecode' of http://87.197.120.129:33300/michal/tbf into develop/SLM-PT50 2026-04-11 11:54:37 +02:00
marekf f9181fee74 Fixed SelectComponentDlg > missing assignment sharedSearchForListBox1.ListBoxEx = availCmpntsLstBox, because of this the application crashes 2026-04-11 11:04:00 +02:00
marekf 4c77d6c06e Add (develop) GenesisCordonelInterface changed project name 2026-04-11 09:33:05 +02:00
marekf b7db39853b Add (develop) GenesisCordonelinterface add TBF.sln project name 2026-04-09 16:44:48 +02:00
marekf 66157ba988 Add (develop) GenesisCordonelinterface - changed GenesisCordonelTester to GenesisCordonelInterface, Add new FormCordonelPreadjustmentUI by Laatzen tool 2026-04-09 16:41:29 +02:00
michal 65ab19290f simulate mode - flow reached 2026-04-09 12:49:00 +02:00
marekf e7e6fc7920 Add (develop) Genesis Cordonel interface - used Laatzen tools in our new tool GenesisCordonelTester 2026-04-09 10:12:00 +02:00
michal 94c7279da1 Add localized string resources for "Test in calculation" and integrate it into FlyingStartMassCollectionSeq
- Add `Test_in_calculation` localized strings to `.resx` files for English, Slovak, and Czech.
- Update `FlyingStartMassCollectionSeq` to display the new activity message during the calculation phase.
2026-04-09 10:08:50 +02:00
michal 2136695b80 Fix Stop 2026-04-08 16:37:27 +02:00
michal c0f9b0ffa0 Refactor GenesisSmartReader stop logic for enhanced thread safety and post-processing; bump assembly version to 3.9.3047.1. 2026-04-08 15:44:59 +02:00
michal c4ef22436f Update GenesisSmartReader Stop logic and bump assembly version to 3.9.3045.1:
- Refactor `Stop` for improved thread safety using `lock` on `_stateSync` and `_stopSync`.
- Enhance `Stop` behavior by introducing state updates during immediate stop requests.
- Fix redundant operations and reorganize log and processing statements for clarity.
- Update `RequestImmediateStopInternal` to accept a new state parameter.
2026-04-08 15:06:45 +02:00
michal 0b73871518 Refactor GenesisSmartReader and add advanced test utilities:
- Introduce `ForceProcessingEnabled`, `InstallSuccessfulProcessingOverride`, and `EnqueueIncomingLine` helpers to streamline test setup.
- Add new test suite `GenesisSmartReaderStopTests` to validate `Stop` behavior for different processing states.
- Enhance `GenesisSmartReader` state management with a dedicated `Reset` method and improved `Stop` logic.
- Improve buffer initialization in `ProcessOptoLine` to address null-value edge cases.
- Update assembly version to `3.9.3043.1`.
2026-04-08 13:51:55 +02:00
michal f7dc6fee5e immediate Stop improve 2026-04-07 16:37:19 +02:00
michal ba848a167d improve 2026-04-07 15:44:32 +02:00
michal dcb0bf9a88 Update GenesisSmartReader logging and bump assembly version to 3.9.3040.1:
- Enhance `Stop` logs with `registerReader` and `optoSerialPort` details for improved traceability.
2026-04-07 15:27:20 +02:00
michal f6433134c1 Add WaitForStartupFlushToFinish and EnableProcessingLoopForTests utilities for improved test reliability:
- Incorporate `WaitForStartupFlushToFinish` in `GenesisSmartReaderThreadedReadTests` to ensure startup flush completion before processing.
- Introduce `EnableProcessingLoopForTests` in `GenesisSmartReaderTest` to streamline test initialization.
- Fix thread-safety issues in startup flush handling and reorder operations in `GenesisSmartReader.Stop`.
- Bump assembly version to `3.9.3039.1`.
2026-04-07 14:45:37 +02:00
michal 7e3df77b5b Refactor GenesisSmartReader processing logic and tests for robust handling:
- Replace property getters with concise expressions in `GenesisSmartReader`.
- Implement FIFO and concurrent producer-consumer unit tests for `ProcessingLoop`.
- Add startup flush mechanism for improved input handling on initialization.
- Refactor processing loop with structured start/stop tasks and cancellation tokens.
- Fix thread-safety issues and enhance logic in `Stop` and `StopDataStreamProcessing`.
- Add internal visibility for tests in `TBFTests` via `InternalsVisibleTo`.
- Update assembly version to `3.9.3038.1`.
2026-04-07 10:42:27 +02:00
marekf ff5954d85b Bugfix FlowMeterInParallel and RegValve OUT OF RANGE regulation part1 2026-04-02 12:02:26 +02:00
michal 08dff1272b Add overflow volume/timestamp handling and related tests for GenesisSmartReader:
- Extend `CalibrationRecord` constructor to include overflow fields (`OverflowVolumeCm`, `OverflowTimeS`).
- Implement additional unit tests in `OptoTelegramRawTest` to validate multi-rollover scenarios and extended calculations.
- Add `GenesisSmartReaderThreadedReadTests` to cover threaded read-loop functionality and serial processing.
- Enhance logging in `Pump` classes (`TurnOff` methods).
- Update project file to include new test files.
2026-04-02 09:25:17 +02:00
marekf c09e266b2c Bugfix ComponentPropertiesDlg frm size 140x80 2026-04-01 12:12:04 +02:00
michal d5c8fd1c8f Refactor GenesisSmartReader with enhanced channel-specific volume and timestamp processing:
- Replace `AverageNullable` with `AverageCachedTime` and introduce `GetCachedVolume`/`GetCachedTime` helpers.
- Add recalibration logic with `_recalculatedStartEndByChannel` and `_rawStartEndByChannel`.
- Implement `PrepareCalculatedChannelData` for refined multi-channel synchronization.
- Add unit tests (`GenesisSmartReaderChannelTests`) for improved coverage and validation of new methods.
- Update `OptoTelegramRaw.Copy` to fix field assignment issues.
2026-03-27 15:12:43 +01:00
michal a34740e838 Update GenesisSmartReaderTest to handle DiscardOutCalls and configure block repetition resets:
- Modify tests to validate `DiscardOutCalls` alongside `DiscardInCalls`.
- Add support for configuring `ResetAfterBlockRepetitions` in test initialization.
2026-03-27 13:19:10 +01:00
michal 836ba5a41f Refactor GenesisSmartReader processing logic and add advanced multi-channel volume and timestamp handling:
- Introduce `TimeDeltaPerChannel` and `GroupRecordsPerChannel` for calculating time and volume deltas across channels.
- Add recalibration logic to synchronize volume and timestamp data with channel-specific maxima.
- Fix `ResetDataBuffer` implementation and replace redundant `ReasetDataBuffer` calls.
- Update handling of flow markers and block completion logic for improved buffer management.
- Add `Copy` method to `OptoTelegramRaw` for efficient cloning and recalculation.
- Bump `AssemblyVersion` and `AssemblyFileVersion` to `3.9.3019.1`.
2026-03-27 13:18:37 +01:00
marekf 545a747ebc Add UniDataStorageWriter component - initial commit 2026-03-27 12:49:35 +01:00
michal 23c83ab452 Enhance GenesisSmartReader multi-channel processing and add tests for telegram handling:
- Refactor `ProcessOptoLine` logic to support output buffer resets at configurable repetition intervals.
- Add tests:
  - `ProcessOptoLine_Block_f_h1_h2_h3_f_ShouldResetBuffersOnlyAfterLastF`
  - `ReadOptoData_FullBlock_ShouldDiscardBuffersAfterClosingF`
  - `ProcessOptoLine_LastF_AfterH3_ShouldRequestBufferReset`
  - `ProcessOptoLine_ShouldReset
2026-03-26 14:45:36 +01:00
michal bc9e583c29 FIX Add ChannelAverages to project and remove unused imports in GenesisHead. 2026-03-26 07:29:13 +01:00
michal 18cef617da Enhance Genesis SmartReader with channel-specific volume and timestamp tracking:
- Add per-channel `VolumeStart`, `VolumeEnd`, `TimeStart`, and `TimeEnd` processing for improved multi-channel support.
- Introduce `ChannelAverages` for centralized average calculations across channels.
- Refactor `GenesisSmartReader` to improve data decoding and logging for calibration and flow test records.
- Add telemetry unwrapping helpers for precise volume and timestamp calculations.
- Update `OptoTelegramRaw` to support channel-specific updates and robust data processing.
- Update `AssemblyVersion` and `AssemblyFileVersion` to `3.9.3013.1`.
2026-03-26 07:19:22 +01:00
michal 4ee736cff5 Add advanced multi-channel processing for Genesis SmartReader:
- Refactor `VolumeLtrStart` and `VolumeLtrEnd` to compute channel-specific averages at test boundaries.
- Implement `ProcessOptoLine_ShouldInsertTelegrams` tests for validating telegram insertion and channel updates.
- Add `VolumeLtrEnd_ShouldAverageOnlyAvailableChannels` to handle partial channel data gracefully.
- Introduce `VolumeFromChannelsAtStart` and `VolumeFromChannelsAtEnd` helpers for refined channel data handling.
- Update Opto telegram processing logic to support robust volume and timestamp unwrapping.
- Enhance `GenesisSmartReader.ToString()` for clearer configuration representation.
- Add `OptoTelegramRawTest` to validate telegram behavior, flag handling, and delta computations.
- Update `AssemblyVersion` to `3.9.3012.1`.
2026-03-24 15:23:06 +01:00
michal 4e40dc8601 Comment out Detect_BaudRate_By_ViewFactoryId test method in TouchReadBaudRateDetectionTests. 2026-03-24 10:07:24 +01:00
michal a5a68ec457 Refactor Genesis serial communication handling (ISerialDriver interface compatible with SerialPort):
- Replace method-based `IsOpen()` checks with property-based `IsOpen` usage in `ISerialDriver` and related classes.
- Simplify `Open()` and add `Close()` methods to unify connection management.
- Introduce `InitializeThreeChannelState()` helper in `GenesisSmartReaderTest` for multi-channel state initialization.
- Adjust calculations in `CalculateTimeByChannels()` and `CalculateVolumeByChannels()` for clarity.
- Add new tests for multi-channel processing and validation of updated telegram handling logic.
2026-03-24 10:04:30 +01:00
michal e26d88d437 Refactor Genesis use 3 chanels reader structure:
- Replace `Xylem.Common` namespace references with `TBF.Rig.RegisterReaders`.
- Introduce `GenesisSmartReaderTest` and `FakeSerialDriver` for unit testing.
- Revamp `FlowDirectionDetection` to support multiple channels.
- Make constants in `StreamingDecoder` public for enhanced accessibility.
- Update `AssemblyVersion` and `AssemblyFileVersion` to `3.9.3010.1`.
2026-03-24 08:53:16 +01:00
marekf 98ba7d2dee Update UniDataStorageReader developing 2026-03-19 19:28:16 +01:00
marekf 78835c1af6 Add UniDataStorageReader initial commit 2026-03-19 16:30:32 +01:00
michal 2522d1da9f Add Genesis radio/opto communication and configuration components
- Replace `OpthoHeadService` with `RadioService` to enhance Genesis communication handling via serial interface.
- Introduce `OptoReceivedEventArgs` to manage event-driven communication.
- Add foundational protocol implementations (`BaseProtocol`, `IProtocol`, etc.) for Genesis configuration and processing.
- Implement `SirtConfig`, `MeterConfig`, and `ProcessConfig` classes for flexible Genesis configuration management.
- Expand Genesis framework to support diagnostics, activity modes, and version retrieval.
2026-03-18 15:57:04 +01:00
michal 8983c01591 Add integration tests for IperlHat communication and diagnostic LED parsing
- Implement `IperlHatIntegrationTests` to validate serial communication, diagnostic LED states, and Opto data handling.
- Add `HexFormatterTest` for verifying Hex formatting utilities.
- Add `DiagnosticLedParserTest` to test parsing for all diagnostic LED states.
2026-03-17 12:15:52 +01:00
michal 61b1320d4f Add Genesis COM port configuration and update Genesis meter setup logic
- Introduce `OptoComPortNr` and `HeadComPortNr` properties in `GenesisHead`.
- Update `SetupGenesisMeter` to use new COM port configurations.
- Add reference to `Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig`.
2026-03-16 15:48:41 +01:00
michal 2c8a0922d1 Genesis dialog with Com ports 2026-03-16 15:47:12 +01:00
michal b078d9586d Add detailed logging for Genesis operations in FlyingStartMassCollectionSeq and FlyingStartSeq.
- Introduce debug and info logs for Genesis initialization, calibration, measurement, and data storage.
- Ensure proper logging during Genesis operations' start and stop phases.
2026-03-16 15:42:45 +01:00
michal 6e35de5f4d Update AssemblyVersion and AssemblyFileVersion to 3.9.3001.1 2026-03-16 15:36:25 +01:00
michal 2dbe4cded4 Genesis slot max count 10, Add DB writer component
Integrate `DatabaseWriter` component and update GenesisHead configuration:

- Add `DatabaseWriter` factory and related classes (`WriteDBCfgCtrl`, `WriterCfg`, `WritingToDB`).
- Extend GenesisHead slot number range to 1-10 and adjust UI layout accordingly.
2026-03-16 15:36:02 +01:00
michal 10865c6878 Update AssemblyVersion and AssemblyFileVersion to 3.9.3000.1 2026-03-16 15:35:06 +01:00
michal ee1353fe54 Add DatabaseWriter component:
- Implement `DatabaseWriter` factory and configuration logic.
- Add `WriteDbCfgCtrl` for component configuration UI.
- Introduce database connection handling, network adapter selection, and tracing record management.
2026-03-16 15:31:58 +01:00
michal 5cefd7fc3a Integrate Genesis meter support into FlyingStartMassCollectionSeq:
- Add initialization, calibration, and measurement logic for Genesis meters.
- Extend result handling to capture Genesis-specific data (timestamps, volumes, errors).
- Ensure proper cleanup of Genesis meters at test conclusion.
2026-03-16 15:31:49 +01:00
michal ab0e5ea82a Genesis heap 2026-03-16 15:17:56 +01:00
michal b2276c086c Merge branch 'develop/SLM-PT50' into develop/Mexico 2026-03-16 13:33:21 +01:00
michal 4fa462661c Merge remote-tracking branch 'remotes/private-origin/develop/SLM-PT50' into develop/Goeteborg 2026-03-16 13:11:34 +01:00
michal 2b30d0cf34 packages add/clean up 2026-03-13 13:51:42 +01:00
michal df2c56e6c4 FIX NaN - devide by zero
Add simulation logic to `StandingStartStopTestOp` and handle zero `TestTime` edge cases in `FlyingStartMassCollectionSeq`
2026-03-12 16:25:26 +01:00
michal a997c3d7be iPerl ASIC - implementation 2026-03-12 14:50:47 +01:00
marekf 3c964f2aab BugFix - repair test RegisterReader deserialize - FSMC method as in SSMC 2026-03-09 14:37:51 +01:00
marekf c445b3e098 BugFix - after applying the transition valve 40% in procedure-purge begin, the RegValve was not regulating correctly after starting the test 2026-03-09 14:20:37 +01:00
marekf 2ea2a2592e Merge branch 'feature/task_6-add-new-admins' into develop/SLM-PT50 2026-03-04 19:14:22 +01:00
marekf 27072598cd Merge branch 'feature/task_5-new-app-icon' into develop/SLM-PT50 2026-03-04 19:14:02 +01:00
marekf 4a2d4772d7 Add new icon to forms of application 2026-03-04 18:48:46 +01:00
marekf 2bf00606d3 Merge branch 'feature/task_4-ListView-ListBox-navigation' into develop/SLM-PT50 2026-03-04 18:42:25 +01:00
marekf 3773e1d96c Merge branch 'feature/task_3-new-pump-grundfoss' into develop/SLM-PT50 2026-03-04 18:42:15 +01:00
marekf 19ddc753c7 Merge branch 'feature/task_2-dripping-on-the-scale-meassure-mass' into develop/SLM-PT50 2026-03-04 18:33:20 +01:00
marekf 0c41c750e8 Add parameter and management IsOffline for components: Modbus>TempMeter>Groch, Meret and Modbus>PressureMeter>Meret and Rig>Keithley>TempMeter and add indicator redColor itemValue for SchematicDrawing 2026-03-04 18:25:28 +01:00
marekf 4bfd5c8e11 Update output printer OnePerMeter - 1. printer configuration in PrintResultsSelectionDlg, 2. document preview, 3. edit document name, 4. enable more save destinations 2026-03-04 13:21:45 +01:00
marekf f0fb70e38b Add new type of pump - Grundfoss 2026-03-04 11:54:39 +01:00
marekf 6e5bcafec0 Update dripping on the scale and measuring the start mass 2026-03-04 10:37:35 +01:00
marekf d5cb18c910 Fixed incorrect loading of RegisterReader in the StandingStartMassCollection method, when the RR Units and RR Quantity variables in results were filled with only string.empty 2026-03-04 09:44:42 +01:00
marekf 3a2069b255 Refactor variable naming in results in response to mass meter pulse processing 2026-03-04 09:42:55 +01:00
marekf 80c651dbfd Add search and navigation as UI>shared for ListBox-es and ListView-s to components listview, components listbox, procedure listview 2026-02-25 13:22:56 +01:00
marekf 5a3b9b57c4 Add new admins marek and michal 2026-02-25 10:02:09 +01:00
marekf ead350eef3 Add initial MassMeter implementation 2026-02-19 19:22:02 +01:00
marekf b43657a4db Initial import from local copy 2026-02-19 12:02:07 +01:00
michal 8fffb9e366 Update clean.bat to remove build artifacts for AppDiagnostic, NfcC7_DLL, NfcC7_DLL.Tests, and TBFTests 2026-01-23 11:04:23 +01:00
michal 0fdd229141 Refactor IPerlImplHeadTestCtrl to use descriptive enums for operations, update command mappings, introduce IPerlASICCorrections, and improve test configuration checks and NFC handling. 2026-01-23 10:51:47 +01:00
michal 2f1ada3f5b Add DiagnosticLedState classes for States #4-#7, enums for PipeStatus and SpikeDetectionStatus, and implement TouchReadProtocol commands, frames, and builders. 2026-01-19 08:10:36 +01:00
michal 988a8c6642 Update NuGetToolVersion to 7.0.0 in SharedComponents project configuration 2025-12-07 11:27:17 +01:00
michal 42ee9eaee3 Poseidon - Flying - Opto communication
Enhance `FlyingStartMassCollectionSeq` with Poseidon reader support, detailed error handling, and improved test data processing.
2025-12-07 11:27:00 +01:00
michal 3f28051d79 Update .gitignore to exclude NfcC7_DLL.Tests build artifacts 2025-12-07 10:59:19 +01:00
michal 65f13cc868 Add UNIHeadTestCtrl interface and implement IperlHeadTestCtrl with command handling logic. 2025-12-06 12:51:51 +01:00
michal cd8ba3cda3 Add System.Threading 4.3.0 package with support for multiple frameworks and localized XML documentation. 2025-12-06 12:49:58 +01:00
michal a5936c8f19 Fix standing start Store Data
Refactor to use `ICommonRegReader` in `StandingStartSeq` and update parameter handling in `SmartCommunicationSeq`.
2025-12-06 12:48:42 +01:00
michal 2842425673 Add simulation logic for test operations and water metrology, enhance UI initialization, and implement optohead flow rate handling.
- Introduced simulation timers in `FlyingStartStopTestOp`.
- Added `Simulate` methods in `WaterMetrologyData`, `WaterMetrologyDataC7`, and `WaterMetrologyDataC2`.
- Enhanced `SmartCommunicationForm` with textbox resizing logic and initialization code.
- Implemented flow rate and volume calculation from optohead telemetry in `SmartReader`.
- Added unit tests for Poseidon correction parsing.
2025-12-06 12:46:12 +01:00
michal 06a401a1ff bugFix - Morrisville - SerialNr, WMBegginValue
Add support for `ICommonRegReader` interface, enhance `ISmartReader` functionality, and update water meter state handling logic across multiple classes.
2025-11-21 14:14:23 +01:00
michal 3a2fc50fec PurchaseOrderDialog logger Improvement - WRCSwindon
Add detailed logging for purchase order workflows in `CycleBeginningForm`

- Introduced `log_selected` for enhanced debugging of selected orders, items, and serial numbers.
- Added exception handling and logging for serial number loading.
- Improved visibility into runtime behavior with contextual debug and error logs.
2025-11-21 14:12:12 +01:00
michal 38a58ed8b7 Scale rainnig solution, see:
Inplementing mass collection update.
Update AssemblyVersion to 3.9.2149.4, refactor mass collection sequence in StandingStartMassCollection, extend PoseidonCmd with enhanced configuration and dialog options, and improve task handling and UI automation.
2025-11-19 16:44:21 +01:00
michal c7cba20de0 Add ReadStableMassOp unit test and enhance MettlerToledo Scale support
- Introduced `ReadStableMassOpTest` to validate mass reading operations.
- Refactored `Scale` to support `ISerialPort` for improved testability.
- Added `SerialPortDevice` and `SerialPortDeviceFake` implementations, with `GetComponent` overload in `Factory`.
- Enhanced `StateMachine` with `InitializeBoardEtc_Fake` for custom setups.
- Updated project files to include new classes.
2025-11-19 16:28:23 +01:00
michal 6311df49c3 Inplementing mass collection update.
Update AssemblyVersion to 3.9.2149.4, refactor mass collection sequence in StandingStartMassCollection, extend PoseidonCmd with enhanced configuration and dialog options, and improve task handling and UI automation.
2025-11-18 10:59:21 +01:00
michal f1d32a39ba ver 3.9.2149.2 ReadPulses added in Run()
Update AssemblyVersion to 3.9.2149.2 and enhance PoseidonReader with new timing and task-tracking functionality.
2025-11-13 15:58:09 +01:00
michal 224b53f774 Ver 3.9.2149.1 - Update AssemblyVersion and AssemblyFileVersion 2025-11-13 14:39:07 +01:00
michal 1e2777c5e7 Enable ShowDialog for PoseidonCmd, add UI improvements in TestStartEndForm, and introduce new methods for handling reader data and controls. 2025-11-13 14:21:23 +01:00
michal c3c21649fb new Test method Poseidon => StandingStartMassCollectionPoseidon
Add support for `StandingStartMassCollectionPoseidon` test methods.

- Introduced `Compound`, `HeatMeters`, and `Single` components for `StandingStartMassCollectionPoseidon`.
- Included factories, configuration classes, and test parameters for new test methods.
- Updated `TBF.csproj` to include new files and resources.
2025-11-12 13:42:19 +01:00
michal 99ccabc142 Smart meters support MainWnd dialog (must be finished - mouse right click), test supports Poseidon RegisterReader
Refactor `ISmartReader` and related classes to support `SmartHeadsUni`. Remove redundant `IperlHeadsUni` references and introduce `SmartMeterFlyingStartMassCollection` functionality. Enhance regex-based head position extraction.
2025-11-12 12:34:29 +01:00
michal f1e6e94450 work backup
- Register Reader Poseidon works
- Smart Form - wrong functionality
- refactoring
2025-11-06 14:11:13 +01:00
michal 320cddb177 compatible version to TBF
Refactor `NfcHanler` namespace to `NfcHandler` and enhance code consistency.
2025-10-29 16:05:21 +01:00
michal 42002e3fa4 iPerl Fixes 2025-10-27 11:49:42 +01:00
michal 77cabfd712 bugfix Parallel CLI Runner 2025-10-27 11:48:22 +01:00
michal c933e2d759 test disabled 2025-10-27 11:47:38 +01:00
michal f3f0a46627 improvemnet, Sensus Developer super user added 2025-10-27 11:46:56 +01:00
michal b5fb4c2947 improvemnet, Sensus Developer super user added 2025-10-27 11:46:34 +01:00
michal f6cce9df3c bugfix Parallel CLI Runner
Additional needed classes
2025-10-27 11:42:12 +01:00
michal c0385c0782 bugfix Parallel CLI Runner
Add parallel execution tests and improve cancellation handling in `CliRunner`

- Introduced new tests (`RunMultipleTimesTestProgram_CheckParalelWork` and `RunMultipleTimesTestProgram_CheckParalelWorkCumulative`) to verify parallel execution behavior.
- Enhanced `SendAsync` and `RunAndCaptureJsonAsync` methods in `CliRunner` with `CancellationToken` support for better task cancellation.
- Refactored process output handling for improved clarity and robustness.
- Added error handling during CLI logger initialization.
2025-10-27 11:38:43 +01:00
michal db43bdb652 FlowMeter improvement
Add `FromDescription` check in `ParseFlowUnit` for better unit parsing
2025-10-27 11:29:58 +01:00
michal 6bdc10f4a7 Merge branch 'master-3' into feature/SmartMeters 2025-10-22 14:37:04 +02:00
michal 9692dc7f4f HeatMeter - columns exchange
Update `ProcedureDlg` to fix `MetersPath` ordering and version bump to 3.9.2149.0
2025-10-22 12:18:01 +02:00
michal 6795793858 Update iPerlReaderUNI configuration handling and validation
- Replace `PoseidonReader.IPerlCfgCtrl` with `RegisterReaders.iPerlReaderUNI.IPerlUniCfgCtrl` for proper configuration control.
- Add null-check and error handling in `ComponentsManagerDlg` to ensure valid default configurations.
- Mark `ITestParams` as `[XmlIgnore]` in `IPerl` configurations to avoid serialization issues.
- Minor import adjustments and functionality improvements for TestMethod classes.
2025-10-21 10:06:29 +02:00
michal a2c564d789 polishing - work now 2025-10-18 09:59:07 +02:00
michal 3bc9e731e8 Move iPerlReaderUNI.communication components to CommonRR.IPerl.communication and rename associated classes for clarity and consistency. 2025-10-14 14:20:26 +02:00
michal 95c5f09238 Working NfcC7_DLL, tests, clean up
"Remove unused NfcHanler classes and utilities"

This commit deletes several obsolete and unused files from the NfcHanler directory, including utility classes, enums, and a large command handling class. This cleanup improves code maintainability by eliminating unnecessary dependencies and clutter.
2025-10-14 13:15:31 +02:00
michal 0a45d66c0b Add SerialFirmwareDownloadTask to NfcC7_DLL for firmware upgrade handling 2025-10-09 11:01:08 +02:00
michal 96408eaef3 Merge branch 'master-3' into feature/SmartMeters
# Conflicts:
#	NfcC7_DLL/Properties/AssemblyInfo.cs
2025-10-06 11:16:36 +02:00
michal cae3ca7cdf HEAT_METERS enabled 2025-10-03 09:59:44 +02:00
michal c8adc093e0 NfcC7_DLL bug fix 2025-10-02 13:34:29 +02:00
michal 4395516216 test project 2025-10-02 13:30:59 +02:00
michal 9281b52464 Poseidon DLL - Comunication Implementation - not finall 2025-10-02 13:28:37 +02:00
michal 6571de7c32 Add NfcC7_DLL project with initial implementation and solution integration 2025-09-29 09:58:09 +02:00
michal a75d66e028 Merge branch 'refs/heads/master-3' into feature/SmartMeters
# Conflicts:
#	TBF.sln.DotSettings.user
2025-09-27 10:27:40 +02:00
michal e839148a6f Ignore .DotSettings.user file 2025-09-27 10:05:09 +02:00
michal 65b502a9b1 Remove TBF.sln.DotSettings.user file 2025-09-27 09:54:47 +02:00
michal 9cde62b2e2 packages added to git
Add `System.Net.Sockets.xml` documentation for zh-Hant locale in `netstandard1.3` API reference.
2025-09-27 09:53:21 +02:00
michal cc86c38246 Update user credentials in Utils.cs 2025-09-26 16:22:00 +02:00
michal 357df87f49 feature/Enhanced_Writer_NoSeparator_AndName 2025-09-26 15:10:34 +02:00
michal 4b33da565c Untrack TBF.sln.DotSettings.user 2025-09-26 15:02:15 +02:00
michal d11f855325 Update .DotSettings.user file with new ResxEditorPersonal configurations 2025-09-26 14:54:22 +02:00
michal eef1f31a21 Update .DotSettings.user file with adjusted ResxEditorPersonal settings 2025-09-26 14:50:49 +02:00
michal b878ee96a5 Merge branch 'refs/heads/master-3' into feature/camera_jms
# Conflicts:
#	TBF.sln.DotSettings.user
#	TBF/Properties/AssemblyInfo.cs
#	TBF/TBF.csproj
#	TBFTests/obj/Debug/TBFTests.csproj.CoreCompileInputs.cache
#	TBFTests/obj/Release/TBFTests.csproj.CoreCompileInputs.cache
2025-09-26 14:27:01 +02:00
michal 97eed27458 Update .DotSettings.user to include Nullable<T>.cs in force-included files. 2025-09-26 14:18:19 +02:00
michal fe08550dc3 iPerlReaderUNI.Factory => TBF components 2025-09-25 16:24:10 +02:00
michal 8a0ae8080f refactor - completisation Smart Meter <= iPerl 2025-09-24 11:57:47 +02:00
michal ab4025e55f Add ISmartTestMethod interface and initial designer file for iPerlCommunicationForm in SharedDialogs 2025-09-23 11:14:04 +02:00
michal 22fffe602c iPerl Reader - NOT FINISHED
Add initial implementation for `iPerlReaderUNI` with `Factory`, `ProcParams`, and `IPerlReader` classes.
2025-09-23 11:10:55 +02:00
michal e4c0219783 packages update
Add Antlr3.Runtime.xml documentation file for API references.
2025-09-22 13:51:32 +02:00
michal 3362fdfaff Remove bin/, obj/, and other build artifacts from Git tracking 2025-09-22 13:46:49 +02:00
michal 6093db4502 Remove bin/, obj/, and other build artifacts from Git tracking 2025-09-22 13:45:20 +02:00
michal 5e7598667b Remove bin/, obj/, and other build artifacts from Git tracking 2025-09-22 13:36:42 +02:00
michal 4fe8729b85 Remove bin/, obj/, and other build artifacts from Git tracking 2025-09-22 13:34:07 +02:00
michal b1dd6666f1 Version increment to 3.9.2147.1 2025-09-22 12:26:02 +02:00
michal a3613889e1 HEAT_METERS disabled
update `.gitignore` with additional folders and files for better coverage.
2025-09-22 12:25:32 +02:00
michal 7b87d63531 PoseidonReader - fix support Cli version 1.4 - Extend TryGetDeviceId to support JSON format and add corresponding tests 2025-09-22 09:35:22 +02:00
michal d838c78a8a CliRunner - Added test and refactor 2025-09-19 12:02:16 +02:00
michal 7a8bef501a HEAT_METERS enabled 2025-09-19 12:00:59 +02:00
michal 9863b54bc8 Enhance ScopedLoggerFactory to support log file compression with rolling, include LogZipService for managing zipped archives, and update CliRunner configuration accordingly. 2025-09-17 13:00:17 +02:00
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 50a38bc557 "Refactor CJMS11 image grab functionality with timeout handling and error resilience
- Introduced a new `GrabImageListener` method with asynchronous timeout support for improved response handling.
- Enhanced error logging and implemented retry logic for capturing images to address NACK scenarios.
- Added overlay rendering and event-based image delivery for better UI integration.
- Refined `SendImageListener` logic to include command handling improvements and listener termination checks.
- Minor parameter adjustments in `OnImageReceived` for default values support."
2025-07-30 10:34:56 +02:00
michal 3e643854bc Add support for multiple image capture and time gap configuration in CJMS11
- Implemented functionality to handle multiple image captures with adjustable time gaps using the new `MultipleImageOpacity` class.
- Enhanced `RoiCfgCtrl` and `RoiCfg` to integrate multi-image configuration.
- Updated CJMS11 camera to support sequential image handling and delegate events for multiple images.
- Introduced UI elements for specifying image count and time gap in the configuration panel.
- Extended `GrabImagesOp` and event arguments to handle and store multiple grabbed images.
- Refactored project to include `MultipleImageOpacity` utility in TBF solution.
2025-07-28 10:16:07 +02:00
michal 0daefb93bb Add CJMS11 enhancements, logging, and resolution support
- Extended CJMS11 camera handling with new functionalities, including image grabbing, resolution configuration, and improved ROI support.
- Added new `ToString` method implementations for enhanced debugging and logging in key classes like `JmsMessage`, `JmsPacket`, and `RoiCfg`.
- Introduced additional commands (`start_stream_images`, `stop_stream_images`) in `CommandM` and its enum.
- Implemented new resolution handling in `RoiCfg` with support for configurable image frames.
- Refactored resolution-related UI elements in `RoiCfgCtrl` to add a dropdown for selecting resolution.
- Made minor UX improvements by replacing inconsistent string formats with verbatim strings in console messages.
- Updated project dependencies with new resolution-related utilities (`Frame` and `ResolutionFrames`).
- Resolved camera-specific symbolic issues by transitioning to `CJMS11.Camera` over prior naming inconsistencies.
2025-07-18 08:50:22 +02:00
michal f5731c67a0 Improve CJMS11 camera connection handling with timeout support
- Replaced synchronous connection retry logic with asynchronous timeout-based handling.
- Added exception handling for connection attempts exceeding 1 second.
- Introduced `EstablishCameraConnectionRepeticaly` with updated timeout intervals for retries.
2025-06-02 09:58:01 +02:00
michal d2ae5f3e83 It works !!! ??
Add support for `System.Net.Sockets`, enhance JMS camera detection, and refactor adapter connection handling

- Added `System.Net.Sockets` as a project dependency and updated the configuration file accordingly.
- Enhanced timeout logic for JMS camera detection, improving reliability in identifying cameras.
- Refactored `NetAdapter` to support async connection handling with better initialization in simulate mode.
- Fixed IP setup for debugging and added new task management for asynchronous operations.
2025-05-30 15:34:21 +02:00
michal c4d332b68b Add JMS network adapter support and multi-camera handling improvements
- Introduced `AdapterJMS` component and configurations, including its factory, control, and designer files.
- Enhanced CJMS11 camera initialization with improved connection handling via multiple retries.
- Updated TbfComponents to include the new JMS adapter factory.
- Refactored camera test methods and connection logic for better reliability and performance.
- Adjusted resource definitions in the project file to include new JMS adapter resources.
2025-05-30 13:44:40 +02:00
michal 1daa0212ef test of connection - multiple connections 2025-05-29 12:59:21 +02:00
michal 1748a83ec8 Add multi-camera initialization and update dependencies
Enhanced camera initialization with parallel and async tests for two cameras. Removed unused Telnet references, adjusted camera indexing logic, and added `System.Drawing.Common` dependency.
2025-05-28 22:50:47 +02:00
michal b3d6b5a59f Refactor camera handling; add UI and image management support.
Replaced legacy UDP and RTP mechanisms with new live stream, grab, and save image functionality using TCP. Introduced event-based UI command handling and image overlay. Updated resource management for improved reliability and added support for saving captured images to disk.
2025-05-26 08:58:46 +02:00
michal 891795b101 Add support for CJMS11 camera integration
Introduced the CJMS11 camera component and its factory in TbfComponents. Added implementation for the CJMS11 camera class, along with unit tests to validate its functionality and integration. This enhances existing camera support in the system.
2025-05-21 11:31:19 +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
Milan Hanajik 0fbc9e2bad DataEntry.Uni bug fixes, ver. 3.6.2086 2023-08-09 12:36:15 +02:00
Milan Hanajik ed5cd89d6a File names of test start and test end pictures are defined in DataEntry.Uni. 2023-08-02 10:19:12 +02:00
Milan Hanajik dd5b20ab38 DataEntry.Uni camera support in TestStartEndForm, ver. 3.6.2072 2023-08-01 11:54:01 +02:00
Milan Hanajik 3f35506b26 TestWizard.TestProfileSelection : Conversion to float avoided. 2023-07-13 13:31:22 +02:00
Milan Hanajik 1ee7e00928 sluprimadev --> deluh1web03 2023-07-12 12:07:15 +02:00
Milan Hanajik ffbfd5ebd5 Ver. 3.6.2068 2023-07-04 13:35:09 +02:00
Milan Hanajik 7a2afd1bdc Bug fix in ProcessTabPageCtrl : Exception when simulating, ver. 3.6.2067 2023-07-03 13:27:08 +02:00
Milan Hanajik 30f9ea19dd OrderManagement : Finish button, Show finished orders check box, ver. 3.0.14 2023-06-24 16:40:36 +02:00
Milan Hanajik 2ec8683b27 UpgradeSelectionDlg implements 3.1 -> 3.2 and 3.2 -> 3.3 2023-06-23 16:48:44 +02:00
Milan Hanajik 4f59f23c6f Clean-up, bug fix in SharedDatabase.Utils.GetTestName( ) - could freeze, ver. 3.6.2062 2023-06-23 16:48:44 +02:00
Milan Hanajik daac273edb DataEntry.Uni re-factorization and minor fix when ORACLE_DB, items in summaryResults. 2023-06-23 16:48:06 +02:00
Milan Hanajik edb084260f Bug in water meter chart fixed : Incorrect error limit lines 2023-06-16 15:30:38 +02:00
Milan Hanajik 8370c7c2e7 1. MainSeqUtils.CreateNewBatchResults( ) : WaterMeterData.ErrLimHi/LoQ initialized properly, 2. comments. 2023-06-16 13:34:24 +02:00
Milan Hanajik 4a394cc5d5 UI.Procedures.ProceduresCtrl : MoreContent.DEAndSequences added. 2023-06-15 11:31:46 +02:00
Milan Hanajik f4db55cc0b S640TestApp to verify web-services, etc. 2023-06-15 11:29:50 +02:00
Milan Hanajik b4f41a2f1f Workplace...S640Stream : New evaluation, Green/yellow progress bar, Interval 400ms, ver. 3.1.19 2023-05-26 14:09:54 +02:00
Milan Hanajik 5b9156d670 PartDlg, PartsCtrl updated, CodeForm of relased workflows can be modified, ver. 3.0.5 2023-05-25 14:54:39 +02:00
Milan Hanajik bebb83f6fc SharedDatabase.Entities.Part.OraDBType removed, CodeType/CodeForm descriptions updated. 2023-05-25 14:54:28 +02:00
Milan Hanajik 130b59fc91 DataEntry.Uni.TestStartEndForm implemented 2023-05-19 15:11:18 +02:00
Milan Hanajik b2a7cfb0d4 DataEntry.Uni Items passed in a list, w/o limits, Cfg with arrays, TODO: TestStartEndForm 2023-05-19 15:11:18 +02:00
Milan Hanajik b67857f658 Access right clean-up for PL. 2023-05-19 15:11:10 +02:00
Milan Hanajik 046fab05c0 S640CommForm bug fix : Crashed when order info was missing. 2023-05-19 10:11:07 +02:00
Milan Hanajik 6004a65572 ver. 3.6.2046 2023-05-11 12:00:21 +02:00
Milan Hanajik 0962efd159 1. DataEntry.Uni implemented, 2. TeststartEndForm with s/n-s, 3. DataEntry.Double24 and Fewa deleted, ver. 3.6.2045 2023-05-11 11:56:43 +02:00
Milan Hanajik cb1a471248 Preparation for DataEntry.Uni 2023-04-24 20:00:49 +02:00
Milan Hanajik 8da049219a TestWizard.VolumeAndErrorSelection fixed - conversion to float avoided. 2023-04-24 20:00:49 +02:00
Milan Hanajik 91b55eb19c 'Starting the system' message on start-up before MainWnd opens, ver. 3.6.2035 2023-04-06 10:55:00 +02:00
Milan Hanajik 6b582bea64 Printing from PreviousResultsDlg, CompoundDetectionTextBox.AppendText( ), ver. 3.6.2035 2023-04-06 08:37:32 +02:00
Milan Hanajik 61910932c2 CombinedWithDetectionSeq, ProcessTabPageCtrl and SeqBase.ReadRegistersTempPressAmbient() changes, ver. 3.6.2030 2023-03-31 11:28:04 +02:00
Milan Hanajik 1ecf528ff0 RegValve.ChangeRegValvePositionOp fixed 2023-03-30 12:07:59 +02:00
Milan Hanajik 9a5ee99a82 TestWizard.FlowSelection fixed, conversion to float avoided. 2023-03-30 10:04:25 +02:00
Milan Hanajik cf626d7b91 Batch.SaveTime introduced, Batch.EndTime calculation modified. 2023-03-30 10:04:14 +02:00
Milan Hanajik b9e8eeab00 UpgradeSelectionDlg changes : ver. 3.3 -> ver. 3.6 2023-03-30 09:09:16 +02:00
Milan Hanajik b880b62924 WMChart can plot error limits other then 2% and 5% and qp,qi style hyperbolic error limits, related DB and UI changes, ver. 3.6.2028 2023-03-24 16:43:21 +01:00
Milan Hanajik 36f8bfa32f All Output.Printers components : string PrinterName parameter specifies printer to be used. 2023-03-14 11:22:38 +01:00
Milan Hanajik 8be3b53db4 default_printer added to Resources.Strings 2023-03-14 11:22:38 +01:00
Milan Hanajik 95759e70b4 DataEntry.Standard24 clean-up, ver. 3.5.2024 2023-03-07 09:54:46 +01:00
Milan Hanajik 2e6a17121f Bug fix in StandingStartMassCollectionSeq 2023-03-06 12:21:43 +01:00
Milan Hanajik ed21db65c3 Uni.RegValveAnalog : Initial implementation for UNI, ver. 3.5.2015 2023-02-13 09:54:05 +01:00
Milan Hanajik d29a425880 Order of saving results to MySql DB and to other destinations changed, try-catch for other destinations. 2023-02-08 10:16:46 +01:00
Milan Hanajik a4139d7a73 Uni.RegValve clean-up. 2023-02-06 15:39:33 +01:00
Milan Hanajik a6a517b6ea Bug fixes : TestRslt.IsStartStop( ), IsRelErrTest( ), IsVolumeMethod( ), ... 2023-02-06 08:54:53 +01:00
Milan Hanajik 07f36f2945 Bug fix in Uni.RegValve.SetFlowOp : 2000 --> flowMeter.NominalFreq, ver. 3.5.2013 2023-01-26 14:57:21 +01:00
Milan Hanajik e2048ed64c Bug fix in Danfoss.VLT2800.Pump, ver. 3.5.2012 2023-01-25 13:42:14 +01:00
Milan Hanajik 90b62779fd Bug fix : DataEntry.StandardCamera.TestStartEndForm crashed when no RR was defined at certain position 2022-12-21 09:37:06 +01:00
Milan Hanajik 1c6488d621 Camera modifications : CheckDeviceCaps( ), CameraBinaryFiles2, etc, ver. 3.5.1997 2022-12-15 16:22:19 +01:00
Milan Hanajik 62e9f612fc Shared buttons : Accelator keys 2022-12-15 16:22:19 +01:00
Milan Hanajik 9e9a01bd43 Approval by legalizator when #define LANG_PL, ver. 3.5.1993 2022-11-30 11:06:39 +01:00
Milan Hanajik 6dcd40c640 Profiles: Method added, imp./exp. fixed, Procedures: Selection by profile, Create from profile button, etc, ver. 3.5.1992 2022-11-25 13:59:35 +01:00
Milan Hanajik b54de856af Power user password changes. 2022-11-21 12:41:29 +01:00
Milan Hanajik 118ce9797f FixedStartMassCollection : Diverter to tank after start valve is closed, ver. 3.4.1981 2022-11-11 14:26:38 +01:00
Milan Hanajik 36ae8479ca 'Winiki lub E' support MeterTestRslt 2022-11-11 14:14:44 +01:00
Milan Hanajik 9ca9d41ddc Browsing previous results : SerialNr can be used as a search criterion. 2022-11-09 12:19:42 +01:00
Milan Hanajik 4f26815e68 PressureMeter : var pressLimit in new double[] { 2.18, 2.2, 2.22, 2.24, 2.26, 2.27 }, ver. 3.4.1977 2022-11-04 12:29:40 +01:00
Milan Hanajik abd68f9a44 BatchNr is displayed in MainWnd status bar. 2022-10-28 15:04:07 +02:00
Milan Hanajik ae8a0ca4c1 Changes in TBF.Rig.Uni.RegValve(s), TBF.Rig.CB.Uni.Action.RegVlvMoveToPos, etc. 2022-10-28 15:04:07 +02:00
Milan Hanajik ac5684a2b5 Config.Entities.OutputPath.RegVPositions added, UI and SequenceBase changes, ver. 3.4.1975 2022-10-28 15:03:58 +02:00
Milan Hanajik 0f738be73e Bug fix 2022-10-21 15:45:53 +02:00
Milan Hanajik 4b85db202e Bug fix, ver. 3.3.1973 2022-10-21 08:46:43 +02:00
Milan Hanajik 96c300d34f PressureMeter.Meret : WaitUntilPressureIsOp conditions, ver. 3.3.1972 2022-10-13 19:13:45 +02:00
Milan Hanajik dbdf1f8fb6 Project dependencies for Workplace (Nanjing) fixed. 2022-10-13 18:22:32 +02:00
Milan Hanajik 6158ee93dc As in 2.30.1971 : StandardCamera.TestStartEndForm with OCR, LiveStreamOp with overlay (test par.), camera does not upload binary files on startup. 2022-10-04 16:46:17 +02:00
Milan Hanajik 6270e0c417 UltrasoundLevelMeter is displayed on the schematic drawing. 2022-09-29 16:59:25 +02:00
Milan Hanajik 67ba9986f2 Renaming transition sequences enhanced.. 2022-09-08 08:16:37 +02:00
Milan Hanajik d2e8f4f0e3 Better on-screen error message when a path is missing in a test, ver. 3.3.1941 2022-08-05 14:58:47 +02:00
Milan c9ea85b7b8 Results project upgraded by VS2022. 2022-08-02 11:49:41 +02:00
Milan Hanajik 86ed8b13bf TestMethods.StandingStartMassCollWODiv added, ver. 3.3.1940 2022-08-02 09:33:37 +02:00
Milan Hanajik 328c170888 StandingStartMassCollection test without a diverter is now possible, ver. 3.3.1935 2022-07-31 17:34:04 +02:00
Milan Hanajik ee31628417 All projects target .Net Framework 4.7.2 2022-07-28 12:50:01 +02:00
Milan Hanajik 267a6557df Bug fix in LocalSettings related to Path/Meters, ver. 3.3.1934 2022-07-28 10:18:32 +02:00
Milan Hanajik 177d17cb81 Sample log4netConfig file modiifed. 2022-07-27 15:05:11 +02:00
Milan Hanajik 4d0441d9a2 Qfrom, Qto, Volume, TestTime : float -> double, config DB change. 2022-07-06 15:51:48 +02:00
Milan Hanajik 01523d3765 Custom units in MetrologyDlg tabs Balance, FlowMeter, PressMeter and TempMeter, ver. 3.3.1928 2022-06-24 14:36:08 +02:00
Milan Hanajik 751f3b29bb Clean-up 2022-06-24 14:34:05 +02:00
Milan Hanajik 969041354b DataStream.Reader.ProcParams class added. 2022-06-14 13:52:08 +02:00
Milan Hanajik ba3fcad44d ErrorFlags and FlyingStartMassCollProlong : English units supported. 2022-06-03 14:21:02 +02:00
Milan Hanajik 877c8446ae TempControl.Novus : (1) fixes in sequence operations implementation, (2) N1040 support. 2022-06-03 14:16:42 +02:00
Milan Hanajik ae6ee631c6 TBF.UI.Bench.Paths controls support imperial units for flow. 2022-06-03 13:53:57 +02:00
Milan Hanajik 155a3a3113 ProcedureDlg clean-up 2022-06-03 13:11:03 +02:00
Milan Hanajik c00f90ed8a SensusTestInfo related : Synchronization with branch 2.28 2022-05-31 09:32:34 +02:00
Milan Hanajik 285facc3fd OneWMResult...Ctrl caption with position and pruefindex, wm.Pruefindex initialized to 0, set in SensusOracle.Database 2022-05-31 09:21:16 +02:00
Milan Hanajik b9d1fe5de7 Simulation of fixed start mass collection method with still camera images possible. 2022-05-31 08:40:51 +02:00
Milan Hanajik 56e519b4e4 Bug fix (Test.TempControl related). 2022-05-31 08:33:39 +02:00
Milan Hanajik 33f5274a6d More Common.CurrentUser related changes (IPERL/ORACLE) 2022-05-30 16:18:56 +02:00
Milan Hanajik f1f662a419 Common..CurrentUser static class with Stack<UserAndForm> userStack, Change( ) and Restore( ). 2022-05-25 15:23:55 +02:00
Milan Hanajik 00fc9ea847 1 "Set temprature setp..." seq. condition never met, 2 FlowMetersInParallel : InactiveFlowmtr for correct display, ver. 3.2.1913 2022-05-16 11:11:05 +02:00
Milan Hanajik b0a534315e Flow control problems when parallel flow meters are used fixed, ver. 3.2.1912 2022-05-16 09:47:59 +02:00
Milan Hanajik 158bba0d27 Bug fix in TempControl.Novus and Easytherm, both ProcParams contains Temp_A/B/C/D/E, related ConditionOp-s, ver. 3.2.1911 2022-05-13 17:49:44 +02:00
Milan Hanajik 4a1eb91c2f Various.CoverTest bug fix, ver. 3.2.1910 2022-05-13 13:48:33 +02:00
Milan Hanajik ae876a649a Tempterature controller setpoint set at the beginning of all tests in the main sequence, ver. 3.2.1909 2022-05-13 13:48:33 +02:00
Milan Hanajik e608c9fd6b UI.Procedures.ProcedureDlg Metrology 2 tab supports TempControl test parameter. 2022-05-13 13:48:17 +02:00
Milan Hanajik a8ba5d5113 string Test.TempControl and string TestData.TempControl added and used in sequences. 2022-05-13 13:47:53 +02:00
Milan Hanajik 2bae912fa0 1 ITempControl moved to GenericDevices, 2 Dummy.TempControl component, 3 TempControl.Easytherm changed to fit ITempControl. 2022-05-13 09:33:03 +02:00
Milan Hanajik 451faf1586 TempControl.Novus : Setpoint step is configurable (incl. rounding) 2022-05-12 12:16:12 +02:00
Milan Hanajik 1a49390ba8 ProcessTabPageCtrl supports compound meters. 2022-05-10 13:05:20 +02:00
Milan Hanajik 395e159522 Water flow related result items cleaned-up, Flow_ctv/_min/_max/_start_/end and Qc removed. 2022-05-10 13:05:20 +02:00
Milan Hanajik fefd846f13 Dead code removed (ProcessTabPageCtrl6/24/48). 2022-05-10 13:05:20 +02:00
Milan Hanajik 19d54d4990 ProcessTabPageCtrl : uses CB Activity, displays S/Ns, supports Flying start and compound meters, ver. 3.1.1907 2022-05-07 14:18:48 +02:00
Milan Hanajik e428897822 ControlBoard Activity added, updated in operations, values are defined in Enums. 2022-05-06 17:18:45 +02:00
Milan Hanajik 1b402566ed Bug fix in FlyingStartMassCollection simulation. 2022-05-06 17:18:45 +02:00
Milan Hanajik 5d23bcade3 Bug fix in Uni.RegValve.SetFlowOp : flowMeter.NominalFreq instead of 2000, ver. 3.1.1903 2022-05-05 10:42:30 +02:00
Milan Hanajik 56d68f0b63 ProcessTabPageCtrl displays PulsesPerLiter fo water meters, ver. 3.1.1902 2022-05-04 14:57:40 +02:00
Milan Hanajik c16e9a8d56 Changes in Results.Entities.TestRslt done in SharedDatabase.Entities.TestRslt as well. 2022-05-04 14:03:26 +02:00
Milan Hanajik 955e55f327 BenchInfo component is loaded and TBF.Data.SetData( ) is called in Program.Main(.) before MainWnd is created. 2022-05-04 12:38:12 +02:00
Milan Hanajik fbd9c976eb FlowMetersInParallel : StartStatistics(test), UpdateStatistics(delta), StopStatistics( ) 2022-05-04 10:56:38 +02:00
Milan Hanajik 2c0ae68db0 IFlowMeterSingle with GetRange(.) and CorrectedFlow(.), Test method calculations clean-up, refactorization, ver. 3.1.1901 2022-05-04 10:23:21 +02:00
Milan Hanajik 9a42e199e3 Uni.FlyingStartStopTestOp bug fix, ver. 3.1.1899 2022-04-29 15:36:45 +02:00
Milan Hanajik e3bb64ef0f Scale display bug fix when units are g, Parallel flowmeter initialization, ReadFlow() fix and logging, ver. 3.1.1898 2022-04-29 14:57:54 +02:00
Milan Hanajik 4361227975 ProcessTabPageCtrl-Test data displed, ProcessData.Mass and RefPulses are properties, ClearProcessValues() at the beginning of each test, etc, ver. 3.1.1896 2022-04-28 09:16:07 +02:00
Milan Hanajik c5d550259f MsrdUnit and MsrdFormat added to ScaleCfg 2022-04-28 09:16:07 +02:00
Milan Hanajik ab140cc6af IFlowMeter, IPressureMeter and ITempMeter extended to support Process tab page updates. 2022-04-26 16:53:10 +02:00
Milan Hanajik 43ce2552a2 Scale capacity, etc. : float --> double 2022-04-26 16:53:10 +02:00
Milan Hanajik d6880fc1b7 TBF.Resources.Strings : Clean-up 2022-04-26 16:53:10 +02:00
Milan Hanajik 4b450846df Bug fix in SchematicDrawing - Diverter edges. 2022-04-26 16:53:10 +02:00
Milan Hanajik 95fb7ab9cc Novus : Setpoint incr/decr from UI, comm. latency removed, isHeating/isCooling evaluation modified, clean-up 2022-04-26 16:53:10 +02:00
Milan Hanajik c5db2c0138 SchematicDrawing.IDrawingItCmpntWithCustomBmp and several bitmaps added, ver. 3.1.1886 2022-04-26 16:53:10 +02:00
Milan Hanajik deabff9a18 TBF.Rig.Modbus.TempControl folder with Easytherm and Novus components. 2022-04-26 16:52:49 +02:00
Milan Hanajik fc81344857 Initialization and logging of several TBF.Rig.Modbus components. 2022-04-26 16:51:23 +02:00
Milan Hanajik fd35f20501 ProcessTabPageCtrl schem. diag. OK, Bridge.StateMachineTickHandler exception handling changed 2022-04-15 13:40:00 +02:00
Milan Hanajik 80f4308ae1 Bug fix in TBF.Rig.Bench/Feeding/Meters/OutputPath 2022-04-15 13:40:00 +02:00
Milan Hanajik 33f823b2d8 UniCB : (1) Supports output bits 0..7 (2) Uses QuidoRS outputs for route bits 64..79 2022-04-15 13:39:49 +02:00
Milan Hanajik 5ad4a07965 Clean-up 2022-04-13 16:05:31 +02:00
Milan Hanajik 03900e453e Bridge.ProcessDataHandler and Bridge.OnProcessData( ) calls removed. 2022-04-08 16:03:45 +02:00
Milan Hanajik e96692405c Leak/PMaxTest refactorization, LeakTest : 1. close valve+pump off 2. delay 3. start mass 4. leak test 5. end mass 2022-04-08 11:50:15 +02:00
Milan Hanajik 4f70997a38 PumpTandem bug fix : Error handling when one of two pumps was renamed. 2022-04-07 15:08:06 +02:00
Milan Hanajik f3a61411f5 Default database type is DBType.MySql. 2022-04-05 12:16:17 +02:00
Milan Hanajik f20acf0e11 DataEntry.Double24 component added. 2022-04-01 12:31:58 +02:00
Milan Hanajik 57e413d6ff iPerlCommunication changes from 2.27 branch : Conditional Q2 error correction fixed, ver. 3.1.1874 2022-04-01 11:18:56 +02:00
Milan Hanajik 12abe09661 (1) Workplace log4net configuration, (2) ControlBoard.Uni comments 2022-04-01 09:16:27 +02:00
Milan Hanajik 4e09cf5adb GenericTest (Laser) : MInimize box enabled, ver. 3.0.2 2022-03-24 07:53:47 +01:00
Milan Hanajik 938da3ac62 DataEntry.S620 : Purchase order re-read before starting form,at the end of the cycle, ver. 3.1.1873 2022-03-23 07:57:53 +01:00
Milan Hanajik 3c59cd1bee Workplace : Order name length up to 10 digits, ver. 3.1.17 2022-03-21 18:28:12 +01:00
Milan Hanajik 8578c7f220 Workplace : OrderInfo updates are transactions, separate DB session for tracing records and OrderInfo updates, ver. 3.1.16 2022-03-17 13:31:15 +01:00
Milan Hanajik f23fc0d4c4 OrderManagement: 1.POName max. 10 digits 2.Modifications by others checked 3.DB updates are transactions 4.Order state refreshed each 5 s 5.version displayed in wnd title, ver. 3.0.13 2022-03-17 13:29:05 +01:00
Milan Hanajik 10b17c250c More logging in DataEntry.S620.FormForMechanicalMetersWithTracing, etc, ver. 3.1.1872 2022-03-09 12:10:14 +01:00
Milan Hanajik 8d47659660 ProcessTabPageCtrl bug fix, Common.Formulas improvement, clean-up, ver. 3.1.1867 2022-01-28 18:35:09 +01:00
Milan Hanajik 08a08282b5 Bug fixes : 1. DaEntry.Std24.TestStartEndForm, 2. StandingStartMassColl mass msrmnt, not finished, process data logging, ver. 3.1.1864 2022-01-28 16:36:58 +01:00
Milan Hanajik 851c51aa7c SetFlowOp with 'delay' parameter (default 0), flow setting starts after this delay in sec. 2022-01-28 14:43:42 +01:00
Milan Hanajik ecc92176f3 Clean-up after comparing 2.27 and 3.1 branches, ver. 3.1.1861 2022-01-28 14:43:42 +01:00
Milan Hanajik 2a97a8f584 UI : ProcedureDlg : TempLo, TempHi, TempUnit, Uncertainty and Repeats in Metrology I and II swapped. 2022-01-28 14:43:42 +01:00
Milan Hanajik c18f06af07 TM.iPerlCommunication and IperlHead synced with v.2.27, ISessionDataMngmnt replaces IHasClearSessionData and IHasTestName. 2022-01-28 14:43:33 +01:00
Milan Hanajik b9b609cabf Clean-up 2022-01-23 20:11:34 +01:00
Milan Hanajik f96bf993d8 Various.Clamping added, Various.CoverTest modified, ver. 3.1.1857 2022-01-21 16:08:03 +01:00
Milan Hanajik 899b379cf7 FeatureVectorCalculator updated to current version. 2022-01-20 18:32:30 +01:00
Milan Hanajik 868d16d8ee Bug fixes in TestMethods.StandingStart, ver. 3.1.1856 2022-01-19 15:42:34 +01:00
Milan Hanajik bfe7c5a29e ProductionTracing : UserLogin, ComboBox history saved, UI-Workflow next to Order, UI-Panel1 size, ver. 3.0.2 2022-01-19 14:03:49 +01:00
Milan Hanajik c7c1c21ab3 TestMethods.StandingStart added, ver. 3.1.1854 2022-01-17 15:30:11 +01:00
Milan Hanajik fe9cfa42ff Bug fixes in test method sequences : return missing in case of a configuration error. 2022-01-17 15:28:18 +01:00
Milan Hanajik 32762f0fdb Bug fix in MeasurementCorrection.GetCorrection( ), ver. 3.1.1853 2022-01-17 12:45:47 +01:00
Milan Hanajik d42ad8c5cf GenericTest and RecordProessing modifications for Laser in Nanjing, ver. 3.0.1 2022-01-17 10:26:56 +01:00
Milan Hanajik 2eaf2b044c SharedDatabase.WorkflowSummary.ReadFromDB(), int wm.ProcessId -> string wm.Workflow, etc. 2022-01-17 10:26:55 +01:00
Milan Hanajik 0b400fcbd0 SharedDatabase.WorkflowSummary added. 2022-01-17 10:26:45 +01:00
Milan Hanajik 7facefb305 Radio address format "D9" defined on one place: SharedDatabase.Const.RAFormat 2022-01-15 13:01:50 +01:00
4369 changed files with 4056084 additions and 58580 deletions
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Root Type="DevExpress.CodeRush.Foundation.CodePlaces.Options.FavoritesListContainer">
<Options Language="Neutral">
<Groups />
</Options>
</Root>
+105 -8
View File
@@ -1,3 +1,12 @@
# Generated build outputs for all projects, including Debug/Release archives.
[Bb]in/
[Oo]bj/
# Generated test results and hardware diagnostic captures.
[Tt]est[Rr]esults/
AppDiagnostic/bin/
AppDiagnostic/obj/
Common/bin/
Common/obj/
Config/bin/
@@ -16,8 +25,6 @@ Encrypt/bin/
Encrypt/obj/
EventViewer/bin/
EventViewer/obj/
Events/bin/
Events/obj/
FeatureVectorCalculator/bin/
FeatureVectorCalculator/obj/
GemCard/bin/
@@ -28,10 +35,18 @@ GenericTest/bin/
GenericTest/obj/
GraphLib/bin/
GraphLib/obj/
LabelPrinting/bin/
LabelPrinting/obj/
MergeResultsDBs/bin/
MergeResultsDBs/obj/
NfcC7_Dll/bin/
NfcC7_Dll/obj/
NfcC7_DLL.Tests/bin/
NfcC7_DLL.Tests/obj/
OrderManagement/bin/
OrderManagement/obj/
ProductionTracing/bin/
ProductionTracing/obj/
RecordProcessing/bin/
RecordProcessing/obj/
ResetBatchNr/bin/
@@ -44,26 +59,108 @@ ResultsBrowser/bin/
ResultsBrowser/obj/
ResultsParser/bin/
ResultsParser/obj/
SharedDatabase/bin
SharedDatabase/obj
SchematicDrawing/bin
SchematicDrawing/obj
S640TestApp/bin/
S640TestApp/obj/
SharedComponents/bin/
SharedComponents/obj/
SharedDatabase/bin/
SharedDatabase/obj/
SchematicDrawing/bin/
SchematicDrawing/obj/
Statistics/bin/
Statistics/obj/
TBF/bin/
TBF/obj/
TBFTests/bin/
TBFTests/obj/
ToFirstMonitor/bin/
ToFirstMonitor/obj/
ToSecondMonitor/bin/
ToSecondMonitor/obj/
Users/bin/
Users/obj/
UserManagement/bin/
UserManagement/obj/
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
TBF.sln.DotSettings.user
/ExternalProjects
/GenesisCordonelTester
/packages/*
!/packages/Common/
/GenesisCordonelInterface/bin/Debug/GenesisCordonelInterfaceLogger.log
/GenesisCordonelInterface/bin/Debug/GenesisCordonelTesterLogger.log
/GenesisCordonelInterface/bin/Debug/SirtConfig.json
/GenesisCordonelInterface/bin/Release
/GenesisCordonelInterface/obj/Debug
/GenesisCordonelInterface/obj/Release
/ExternalProjects
/AppDiagnostic.Logging/bin/Debug/net472/AppDiagnostic.Logging.dll
/AppDiagnostic.Logging/bin/Debug/net472/AppDiagnostic.Logging.pdb
/AppDiagnostic.Logging/obj/Debug/net472/AppDiagnostic.Logging.AssemblyInfo.cs
/AppDiagnostic.Logging/obj/Debug/net472/AppDiagnostic.Logging.AssemblyInfoInputs.cache
/AppDiagnostic.Logging/obj/Debug/net472/AppDiagnostic.Logging.csproj.AssemblyReference.cache
/AppDiagnostic.Logging/obj/Debug/net472/AppDiagnostic.Logging.dll
/AppDiagnostic.Logging/obj/Debug/net472/AppDiagnostic.Logging.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Metrology.Measurements.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Metrology.Measurements.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Ui.CordonelPreadjustmentUi.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Ui.GenesisToolBox.exe
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Ui.GenesisToolBox.pdb
/GenesisCordonelInterface/bin/Debug/XylemCommonUiLegacyGenCtl.dll
/GenesisCordonelInterface/bin/Debug/XylemCommonUiLegacyGenCtl.pdb
/GenesisCordonelInterface/bin/Debug/de/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.resources.dll
/GenesisCordonelInterface/bin/Debug/GenesisCordonelInterface.exe
/GenesisCordonelInterface/bin/Debug/GenesisCordonelInterface.pdb
/GenesisCordonelInterface/bin/Debug/TempFlansh.exe
/GenesisCordonelInterface/bin/Debug/TempFlansh.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Logic.RelatePcb.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Logic.RelatePcb.pdb
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Logic.ServiceCore.dll
/GenesisCordonelInterface/bin/Debug/Xylem.Common.Logic.ServiceCore.pdb
/GenesisCordonelInterface/RuntimePackage/Package
/SharedComponents/obj/SharedComponents.csproj.nuget.g.props
/AppDiagnostic.Logging/obj/Release/net472/AppDiagnostic.Logging.AssemblyInfo.cs
/AppDiagnostic.Logging/obj/Release/net472/AppDiagnostic.Logging.AssemblyInfoInputs.cache
/AppDiagnostic.Logging/obj/Release/net472/AppDiagnostic.Logging.csproj.AssemblyReference.cache
/AppDiagnostic.Logging/obj/Release/net472/AppDiagnostic.Logging.dll
/AppDiagnostic.Logging/obj/Release/net472/AppDiagnostic.Logging.pdb
/AppDiagnostic.Logging/bin/Release/net472/AppDiagnostic.Logging.dll
/AppDiagnostic.Logging/bin/Release/net472/AppDiagnostic.Logging.pdb
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<LangVersion>7.3</LangVersion>
<RootNamespace>AppDiagnostic.Logging</RootNamespace>
<AssemblyName>AppDiagnostic.Logging</AssemblyName>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<ProjectGuid>{A7AF8ED2-362E-4DBB-B607-EBA2820719EC}</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="5.2.2" />
<Reference Include="System.Runtime.Serialization" />
</ItemGroup>
</Project>
@@ -0,0 +1,41 @@
using NLog;
using NLog.Config;
using NLog.Layouts;
namespace AppDiagnostic.Logging
{
public static class AppDiagnosticConnector
{
private static readonly object syncRoot = new object();
public static void Register()
{
lock (syncRoot)
{
LoggingConfiguration configuration = LogManager.Configuration ?? new LoggingConfiguration();
NLog.Targets.Target existingTarget = configuration.FindTargetByName("appDiagnostic");
if (existingTarget != null)
{
return;
}
var target = new AppDiagnosticTarget
{
Name = "appDiagnostic",
PipeName = DiagnosticProtocol.DefaultPipeName,
QueueLimit = DiagnosticProtocol.DefaultQueueLimit,
ReconnectDelayMilliseconds = DiagnosticProtocol.DefaultReconnectDelayMilliseconds,
ConnectTimeoutMilliseconds = DiagnosticProtocol.DefaultConnectTimeoutMilliseconds,
Layout = new SimpleLayout("${message}")
};
configuration.AddTarget(target.Name, target);
configuration.AddRule(LogLevel.Trace, LogLevel.Fatal, target, "*");
LogManager.Configuration = configuration;
LogManager.ReconfigExistingLoggers();
}
}
}
}
@@ -0,0 +1,233 @@
using NLog;
using NLog.Targets;
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
namespace AppDiagnostic.Logging
{
[Target("AppDiagnostic")]
public sealed class AppDiagnosticTarget : TargetWithLayout
{
private readonly object connectionLock = new object();
private readonly string applicationName;
private readonly int processId;
private BlockingCollection<DiagnosticLogEntry> queue;
private CancellationTokenSource cancellation;
private Task senderTask;
private NamedPipeClientStream pipeClient;
public AppDiagnosticTarget()
{
using (Process process = Process.GetCurrentProcess())
{
applicationName = process.ProcessName;
processId = process.Id;
}
PipeName = DiagnosticProtocol.DefaultPipeName;
QueueLimit = DiagnosticProtocol.DefaultQueueLimit;
ReconnectDelayMilliseconds =
DiagnosticProtocol.DefaultReconnectDelayMilliseconds;
ConnectTimeoutMilliseconds =
DiagnosticProtocol.DefaultConnectTimeoutMilliseconds;
}
public string PipeName { get; set; }
public int QueueLimit { get; set; }
public int ReconnectDelayMilliseconds { get; set; }
public int ConnectTimeoutMilliseconds { get; set; }
protected override void InitializeTarget()
{
base.InitializeTarget();
int queueLimit = QueueLimit > 0
? QueueLimit
: DiagnosticProtocol.DefaultQueueLimit;
queue = new BlockingCollection<DiagnosticLogEntry>(queueLimit);
cancellation = new CancellationTokenSource();
senderTask = Task.Factory.StartNew(
ProcessQueue,
cancellation.Token,
TaskCreationOptions.LongRunning,
TaskScheduler.Default);
}
protected override void Write(LogEventInfo logEvent)
{
if (logEvent == null || queue == null || queue.IsAddingCompleted)
{
return;
}
var entry = new DiagnosticLogEntry
{
TimestampUtc = logEvent.TimeStamp.ToUniversalTime(),
MachineName = Environment.MachineName,
ApplicationName = applicationName,
ProcessId = processId,
LoggerName = logEvent.LoggerName ?? string.Empty,
Level = logEvent.Level?.Name ?? string.Empty,
Message = Layout != null
? Layout.Render(logEvent)
: logEvent.FormattedMessage,
Exception = logEvent.Exception?.ToString() ?? string.Empty
};
try
{
queue.TryAdd(entry);
}
catch (ObjectDisposedException)
{
// A concurrent NLog shutdown may dispose the queue.
}
catch (InvalidOperationException)
{
// A concurrent NLog shutdown may complete the queue.
}
}
protected override void CloseTarget()
{
BlockingCollection<DiagnosticLogEntry> currentQueue = queue;
CancellationTokenSource currentCancellation = cancellation;
if (currentQueue != null)
{
currentQueue.CompleteAdding();
}
if (currentCancellation != null)
{
currentCancellation.Cancel();
}
CloseConnection();
try
{
senderTask?.Wait(2000);
}
catch (AggregateException)
{
// Cancellation during application shutdown is expected.
}
currentQueue?.Dispose();
currentCancellation?.Dispose();
queue = null;
cancellation = null;
senderTask = null;
base.CloseTarget();
}
private void ProcessQueue()
{
CancellationToken token = cancellation.Token;
try
{
foreach (DiagnosticLogEntry entry in
queue.GetConsumingEnumerable(token))
{
SendWhenConnected(entry, token);
}
}
catch (OperationCanceledException)
{
// Target shutdown is expected to cancel the sender.
}
}
private void SendWhenConnected(
DiagnosticLogEntry entry,
CancellationToken token)
{
while (!token.IsCancellationRequested)
{
try
{
EnsureConnected();
DiagnosticMessageSerializer.WriteFramed(pipeClient, entry);
return;
}
catch (Exception exception) when (
exception is IOException ||
exception is TimeoutException ||
exception is InvalidOperationException)
{
CloseConnection();
int delay = ReconnectDelayMilliseconds > 0
? ReconnectDelayMilliseconds
: DiagnosticProtocol.DefaultReconnectDelayMilliseconds;
if (token.WaitHandle.WaitOne(delay))
{
return;
}
}
}
}
private void EnsureConnected()
{
lock (connectionLock)
{
if (pipeClient != null && pipeClient.IsConnected)
{
return;
}
CloseConnectionWithoutLock();
pipeClient = new NamedPipeClientStream(
".",
string.IsNullOrWhiteSpace(PipeName)
? DiagnosticProtocol.DefaultPipeName
: PipeName,
PipeDirection.Out,
PipeOptions.Asynchronous);
int timeout = ConnectTimeoutMilliseconds > 0
? ConnectTimeoutMilliseconds
: DiagnosticProtocol.DefaultConnectTimeoutMilliseconds;
pipeClient.Connect(timeout);
}
}
private void CloseConnection()
{
lock (connectionLock)
{
CloseConnectionWithoutLock();
}
}
private void CloseConnectionWithoutLock()
{
if (pipeClient == null)
{
return;
}
pipeClient.Dispose();
pipeClient = null;
}
}
}
@@ -0,0 +1,33 @@
using System;
using System.Runtime.Serialization;
namespace AppDiagnostic.Logging
{
[DataContract]
public sealed class DiagnosticLogEntry
{
[DataMember(Order = 1)]
public DateTime TimestampUtc { get; set; }
[DataMember(Order = 2)]
public string MachineName { get; set; }
[DataMember(Order = 3)]
public string ApplicationName { get; set; }
[DataMember(Order = 4)]
public int ProcessId { get; set; }
[DataMember(Order = 5)]
public string LoggerName { get; set; }
[DataMember(Order = 6)]
public string Level { get; set; }
[DataMember(Order = 7)]
public string Message { get; set; }
[DataMember(Order = 8)]
public string Exception { get; set; }
}
}
@@ -0,0 +1,113 @@
using System;
using System.IO;
using System.Runtime.Serialization.Json;
namespace AppDiagnostic.Logging
{
public static class DiagnosticMessageSerializer
{
private static readonly DataContractJsonSerializer Serializer =
new DataContractJsonSerializer(typeof(DiagnosticLogEntry));
private static readonly object SerializerLock = new object();
public static byte[] Serialize(DiagnosticLogEntry entry)
{
if (entry == null)
{
throw new ArgumentNullException(nameof(entry));
}
using (var stream = new MemoryStream())
{
lock (SerializerLock)
{
Serializer.WriteObject(stream, entry);
}
return stream.ToArray();
}
}
public static DiagnosticLogEntry Deserialize(byte[] payload)
{
if (payload == null)
{
throw new ArgumentNullException(nameof(payload));
}
if (payload.Length == 0 ||
payload.Length > DiagnosticProtocol.MaximumMessageSize)
{
throw new InvalidDataException("Invalid diagnostic message size.");
}
using (var stream = new MemoryStream(payload, false))
{
lock (SerializerLock)
{
return (DiagnosticLogEntry)Serializer.ReadObject(stream);
}
}
}
public static void WriteFramed(Stream stream, DiagnosticLogEntry entry)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
byte[] payload = Serialize(entry);
if (payload.Length > DiagnosticProtocol.MaximumMessageSize)
{
throw new InvalidDataException("Diagnostic message is too large.");
}
byte[] length = BitConverter.GetBytes(payload.Length);
stream.Write(length, 0, length.Length);
stream.Write(payload, 0, payload.Length);
stream.Flush();
}
public static DiagnosticLogEntry ReadFramed(Stream stream)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
byte[] lengthBuffer = ReadExactly(stream, sizeof(int));
int payloadLength = BitConverter.ToInt32(lengthBuffer, 0);
if (payloadLength <= 0 ||
payloadLength > DiagnosticProtocol.MaximumMessageSize)
{
throw new InvalidDataException("Invalid diagnostic message size.");
}
return Deserialize(ReadExactly(stream, payloadLength));
}
private static byte[] ReadExactly(Stream stream, int count)
{
byte[] buffer = new byte[count];
int offset = 0;
while (offset < count)
{
int bytesRead = stream.Read(buffer, offset, count - offset);
if (bytesRead == 0)
{
throw new EndOfStreamException();
}
offset += bytesRead;
}
return buffer;
}
}
}
@@ -0,0 +1,11 @@
namespace AppDiagnostic.Logging
{
public static class DiagnosticProtocol
{
public const string DefaultPipeName = "Sensus.AppDiagnostic.LogPipe";
public const int MaximumMessageSize = 1024 * 1024;
public const int DefaultQueueLimit = 10000;
public const int DefaultReconnectDelayMilliseconds = 500;
public const int DefaultConnectTimeoutMilliseconds = 250;
}
}
+37
View File
@@ -0,0 +1,37 @@
# AppDiagnostic.Logging
Reusable NLog target for sending structured diagnostic events from multiple
.NET Framework processes to `AppDiagnostic.exe` through a local named pipe.
## Producer integration
Reference this project from the producer application and add the extension and
target to its NLog configuration:
```xml
<extensions>
<add assembly="AppDiagnostic.Logging" />
</extensions>
<targets>
<target name="appDiagnostic"
xsi:type="AppDiagnostic"
layout="${message}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="appDiagnostic" />
</rules>
```
The target writes to a bounded background queue. Producer threads are not
blocked while the diagnostic viewer is unavailable. Queued messages are sent
after the viewer becomes available; new messages are discarded when the queue
limit is reached.
The receiver can read messages with:
```csharp
DiagnosticLogEntry entry =
DiagnosticMessageSerializer.ReadFramed(namedPipeServerStream);
```
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,65 @@
{
"format": 1,
"restore": {
"C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj": {}
},
"projects": {
"C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj",
"projectName": "AppDiagnostic.Logging",
"projectPath": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj",
"packagesPath": "C:\\Users\\MFRNIAK\\.nuget\\packages\\",
"outputPath": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\MFRNIAK\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net472"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net472": {
"framework": "net472",
"targetAlias": "net472",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net472": {
"framework": "net472",
"targetAlias": "net472",
"dependencies": {
"NLog": {
"target": "Package",
"version": "[5.2.2, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.303\\RuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\MFRNIAK\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\MFRNIAK\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1,8 @@
is_global = true
build_property.RootNamespace = AppDiagnostic.Logging
build_property.ProjectDir = C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1 @@
551ba94934db30a277a1a9cec2dacbe03f8393107e5d0b2436695f9bd62bd569
@@ -0,0 +1,11 @@
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\bin\Debug\net472\AppDiagnostic.Logging.dll
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\bin\Debug\net472\AppDiagnostic.Logging.pdb
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\bin\Debug\net472\NLog.dll
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.csproj.AssemblyReference.cache
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.GeneratedMSBuildEditorConfig.editorconfig
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.AssemblyInfoInputs.cache
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.AssemblyInfo.cs
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.csproj.CoreCompileInputs.cache
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagn.CFEA7AC0.Up2Date
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.dll
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Debug\net472\AppDiagnostic.Logging.pdb
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1,8 @@
is_global = true
build_property.RootNamespace = AppDiagnostic.Logging
build_property.ProjectDir = C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1 @@
a53d59482cad49b656138b1af5cf3e55edf2108969aedc574c362be6c671436b
@@ -0,0 +1,11 @@
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\bin\Release\net472\AppDiagnostic.Logging.dll
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\bin\Release\net472\AppDiagnostic.Logging.pdb
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\bin\Release\net472\NLog.dll
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.csproj.AssemblyReference.cache
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.GeneratedMSBuildEditorConfig.editorconfig
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.AssemblyInfoInputs.cache
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.AssemblyInfo.cs
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.csproj.CoreCompileInputs.cache
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagn.CFEA7AC0.Up2Date
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.dll
C:\Sensus_projects\New\LocalBranch_start_at_6.3.2026\tbf-local\tbf\AppDiagnostic.Logging\obj\Release\net472\AppDiagnostic.Logging.pdb
@@ -0,0 +1,119 @@
{
"version": 4,
"targets": {
"net472": {
"NLog/5.2.2": {
"type": "package",
"frameworkAssemblies": [
"System",
"System.Configuration",
"System.Core",
"System.IO.Compression",
"System.Xml"
],
"compile": {
"lib/net46/NLog.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net46/NLog.dll": {
"related": ".xml"
}
}
}
}
},
"libraries": {
"NLog/5.2.2": {
"sha512": "r6Q9740g29gTwmTWlsgdIFm0mhNsfNZmbvWKX/Fxmi8X89ZrpUowHM2T2X1lP7RVpND+ef+XnfKL5g6Q1iNGXA==",
"type": "package",
"path": "nlog/5.2.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"N.png",
"lib/net35/NLog.dll",
"lib/net35/NLog.xml",
"lib/net45/NLog.dll",
"lib/net45/NLog.xml",
"lib/net46/NLog.dll",
"lib/net46/NLog.xml",
"lib/netstandard1.3/NLog.dll",
"lib/netstandard1.3/NLog.xml",
"lib/netstandard1.5/NLog.dll",
"lib/netstandard1.5/NLog.xml",
"lib/netstandard2.0/NLog.dll",
"lib/netstandard2.0/NLog.xml",
"nlog.5.2.2.nupkg.sha512",
"nlog.nuspec"
]
}
},
"projectFileDependencyGroups": {
"net472": [
"NLog >= 5.2.2"
]
},
"packageFolders": {
"C:\\Users\\MFRNIAK\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj",
"projectName": "AppDiagnostic.Logging",
"projectPath": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj",
"packagesPath": "C:\\Users\\MFRNIAK\\.nuget\\packages\\",
"outputPath": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\MFRNIAK\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net472"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net472": {
"framework": "net472",
"targetAlias": "net472",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net472": {
"framework": "net472",
"targetAlias": "net472",
"dependencies": {
"NLog": {
"target": "Package",
"version": "[5.2.2, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.303\\RuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,10 @@
{
"version": 2,
"dgSpecHash": "ezwKOPZAAXU=",
"success": true,
"projectFilePath": "C:\\Sensus_projects\\New\\LocalBranch_start_at_6.3.2026\\tbf-local\\tbf\\AppDiagnostic.Logging\\AppDiagnostic.Logging.csproj",
"expectedPackageFiles": [
"C:\\Users\\MFRNIAK\\.nuget\\packages\\nlog\\5.2.2\\nlog.5.2.2.nupkg.sha512"
],
"logs": []
}
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+104
View File
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FA9ABAD1-7184-4295-ADE8-D44F2E3DE6B2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AppDiagnostic</RootNamespace>
<AssemblyName>AppDiagnostic</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</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|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ColorRuleEditorForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DiagnosticLogFormatter.cs" />
<Compile Include="DiagnosticLogStore.cs" />
<Compile Include="DiagnosticPipeServer.cs" />
<Compile Include="LogColorizer.cs" />
<Compile Include="LogColorRule.cs" />
<Compile Include="LogColorRuleRepository.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AppDiagnostic.Logging\AppDiagnostic.Logging.csproj">
<Project>{A7AF8ED2-362E-4DBB-B607-EBA2820719EC}</Project>
<Name>AppDiagnostic.Logging</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\TBF_icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public class BufferedListView : ListView
{
public BufferedListView()
{
// Zapne dvojité bufferovanie pre ListView
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
this.UpdateStyles();
}
}
+319
View File
@@ -0,0 +1,319 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace AppDiagnostic
{
public sealed class ColorRuleEditorForm : Form
{
private readonly List<LogColorRule> rules;
private readonly ListBox ruleList = new ListBox();
private readonly TextBox patternTextBox = new TextBox();
private readonly CheckBox enabledCheckBox = new CheckBox();
private readonly CheckBox boldCheckBox = new CheckBox();
private readonly CheckBox backgroundCheckBox = new CheckBox();
private readonly Button foregroundButton = new Button();
private readonly Button backgroundButton = new Button();
private readonly RichTextBox previewBox = new RichTextBox();
private readonly Font previewBoldFont;
private bool loadingRule;
public ColorRuleEditorForm(IEnumerable<LogColorRule> sourceRules)
{
rules = sourceRules.Select(rule => rule.Clone()).ToList();
InitializeWindow();
previewBoldFont = new Font(previewBox.Font, FontStyle.Bold);
RefreshRuleList(0);
RefreshPreview();
}
public List<LogColorRule> Rules => rules.Select(rule => rule.Clone()).ToList();
protected override void Dispose(bool disposing)
{
if (disposing)
{
previewBoldFont.Dispose();
}
base.Dispose(disposing);
}
private void InitializeWindow()
{
Text = "Log color rules";
Icon = Properties.Resources.TBF_icon;
StartPosition = FormStartPosition.CenterParent;
MinimumSize = new Size(760, 500);
ClientSize = new Size(860, 560);
var root = new TableLayoutPanel { Dock = DockStyle.Fill, ColumnCount = 1, RowCount = 3, Padding = new Padding(10) };
root.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
root.RowStyles.Add(new RowStyle(SizeType.Absolute, 145F));
root.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
var split = new SplitContainer { Dock = DockStyle.Fill, SplitterDistance = 280 };
split.Panel1.Padding = new Padding(0, 0, 8, 0);
split.Panel2.Padding = new Padding(8, 0, 0, 0);
ruleList.Dock = DockStyle.Fill;
ruleList.IntegralHeight = false;
ruleList.SelectedIndexChanged += RuleList_SelectedIndexChanged;
var listButtons = new FlowLayoutPanel { Dock = DockStyle.Bottom, Height = 36, FlowDirection = FlowDirection.LeftToRight };
listButtons.Controls.Add(CreateButton("Add", AddRule_Click));
listButtons.Controls.Add(CreateButton("Delete", DeleteRule_Click));
listButtons.Controls.Add(CreateButton("Up", MoveUp_Click));
listButtons.Controls.Add(CreateButton("Down", MoveDown_Click));
split.Panel1.Controls.Add(ruleList);
split.Panel1.Controls.Add(listButtons);
var editor = new TableLayoutPanel { Dock = DockStyle.Top, AutoSize = true, ColumnCount = 2, Padding = new Padding(4) };
editor.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F));
editor.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
enabledCheckBox.Text = "Rule enabled";
enabledCheckBox.AutoSize = true;
enabledCheckBox.CheckedChanged += EditorValueChanged;
AddEditorRow(editor, "State", enabledCheckBox);
patternTextBox.Dock = DockStyle.Fill;
patternTextBox.TextChanged += EditorValueChanged;
AddEditorRow(editor, "Substring", patternTextBox);
foregroundButton.Text = "Choose text color...";
foregroundButton.AutoSize = true;
foregroundButton.Click += ForegroundButton_Click;
AddEditorRow(editor, "Text color", foregroundButton);
var backgroundPanel = new FlowLayoutPanel { Dock = DockStyle.Fill, AutoSize = true };
backgroundCheckBox.Text = "Use background";
backgroundCheckBox.AutoSize = true;
backgroundCheckBox.CheckedChanged += EditorValueChanged;
backgroundButton.Text = "Choose...";
backgroundButton.AutoSize = true;
backgroundButton.Click += BackgroundButton_Click;
backgroundPanel.Controls.Add(backgroundCheckBox);
backgroundPanel.Controls.Add(backgroundButton);
AddEditorRow(editor, "Background", backgroundPanel);
boldCheckBox.Text = "Bold text";
boldCheckBox.AutoSize = true;
boldCheckBox.CheckedChanged += EditorValueChanged;
AddEditorRow(editor, "Font", boldCheckBox);
var resetButton = CreateButton("Restore default rules", RestoreDefaults_Click);
resetButton.AutoSize = true;
AddEditorRow(editor, string.Empty, resetButton);
split.Panel2.Controls.Add(editor);
previewBox.Dock = DockStyle.Fill;
previewBox.ReadOnly = true;
previewBox.WordWrap = true;
previewBox.Font = new Font("Consolas", 9F);
previewBox.Text = "2026-09-10 14:25:31.042|DEBUG|TBF[14280]|TBF.UI.MainWnd|Device configuration loaded.\n2026-09-10 14:25:31.384|INFO |TBF[14280]|TBF.Rig.StateMachine|Test bench started.\n2026-09-10 14:25:32.018|WARN |TBF[14280]|TBF.Device|Pressure is approaching the limit.\n2026-09-10 14:25:32.611|ERROR|TBF[14280]|TBF.Device|Communication failed.";
var previewGroup = new GroupBox { Text = "Live preview", Dock = DockStyle.Fill, Padding = new Padding(8) };
previewGroup.Controls.Add(previewBox);
var footer = new FlowLayoutPanel { Dock = DockStyle.Fill, FlowDirection = FlowDirection.RightToLeft, Padding = new Padding(0, 8, 0, 0) };
var okButton = new Button { Text = "OK", DialogResult = DialogResult.OK, AutoSize = true };
var cancelButton = new Button { Text = "Cancel", DialogResult = DialogResult.Cancel, AutoSize = true };
footer.Controls.Add(okButton);
footer.Controls.Add(cancelButton);
AcceptButton = okButton;
CancelButton = cancelButton;
root.Controls.Add(split, 0, 0);
root.Controls.Add(previewGroup, 0, 1);
root.Controls.Add(footer, 0, 2);
Controls.Add(root);
}
private static Button CreateButton(string text, EventHandler clickHandler)
{
var button = new Button { Text = text, AutoSize = true };
button.Click += clickHandler;
return button;
}
private static void AddEditorRow(TableLayoutPanel panel, string labelText, Control control)
{
int row = panel.RowCount++;
panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
var label = new Label { Text = labelText, AutoSize = true, Anchor = AnchorStyles.Left, Margin = new Padding(3, 8, 3, 3) };
control.Margin = new Padding(3, 5, 3, 5);
panel.Controls.Add(label, 0, row);
panel.Controls.Add(control, 1, row);
}
private void RefreshRuleList(int selectedIndex)
{
ruleList.BeginUpdate();
ruleList.Items.Clear();
foreach (LogColorRule rule in rules)
{
ruleList.Items.Add(rule);
}
ruleList.EndUpdate();
if (rules.Count > 0)
{
ruleList.SelectedIndex = Math.Max(0, Math.Min(selectedIndex, rules.Count - 1));
}
}
private void RuleList_SelectedIndexChanged(object sender, EventArgs e)
{
LogColorRule rule = ruleList.SelectedItem as LogColorRule;
if (rule == null)
{
return;
}
loadingRule = true;
enabledCheckBox.Checked = rule.Enabled;
patternTextBox.Text = rule.Pattern;
foregroundButton.BackColor = rule.ForeColor;
backgroundCheckBox.Checked = rule.UseBackColor;
backgroundButton.Enabled = rule.UseBackColor;
backgroundButton.BackColor = rule.UseBackColor ? rule.BackColor : SystemColors.Control;
boldCheckBox.Checked = rule.Bold;
loadingRule = false;
}
private void EditorValueChanged(object sender, EventArgs e)
{
if (loadingRule)
{
return;
}
LogColorRule rule = ruleList.SelectedItem as LogColorRule;
if (rule == null)
{
return;
}
rule.Enabled = enabledCheckBox.Checked;
rule.Pattern = patternTextBox.Text;
rule.UseBackColor = backgroundCheckBox.Checked;
rule.Bold = boldCheckBox.Checked;
backgroundButton.Enabled = rule.UseBackColor;
int index = ruleList.SelectedIndex;
RefreshRuleList(index);
RefreshPreview();
}
private void ForegroundButton_Click(object sender, EventArgs e)
{
LogColorRule rule = ruleList.SelectedItem as LogColorRule;
if (rule == null)
{
return;
}
using (var dialog = new ColorDialog { Color = rule.ForeColor, FullOpen = true })
{
if (dialog.ShowDialog(this) != DialogResult.OK)
{
return;
}
rule.ForeColorArgb = dialog.Color.ToArgb();
foregroundButton.BackColor = dialog.Color;
RefreshPreview();
}
}
private void BackgroundButton_Click(object sender, EventArgs e)
{
LogColorRule rule = ruleList.SelectedItem as LogColorRule;
if (rule == null)
{
return;
}
Color initialColor = rule.UseBackColor ? rule.BackColor : SystemColors.Window;
using (var dialog = new ColorDialog { Color = initialColor, FullOpen = true })
{
if (dialog.ShowDialog(this) != DialogResult.OK)
{
return;
}
rule.BackColorArgb = dialog.Color.ToArgb();
rule.UseBackColor = true;
backgroundCheckBox.Checked = true;
backgroundButton.BackColor = dialog.Color;
RefreshPreview();
}
}
private void AddRule_Click(object sender, EventArgs e)
{
rules.Add(new LogColorRule { Pattern = "NEW SUBSTRING", ForeColorArgb = Color.MediumPurple.ToArgb() });
RefreshRuleList(rules.Count - 1);
patternTextBox.Focus();
patternTextBox.SelectAll();
}
private void DeleteRule_Click(object sender, EventArgs e)
{
int index = ruleList.SelectedIndex;
if (index < 0)
{
return;
}
rules.RemoveAt(index);
RefreshRuleList(Math.Min(index, rules.Count - 1));
RefreshPreview();
}
private void MoveUp_Click(object sender, EventArgs e)
{
MoveSelectedRule(-1);
}
private void MoveDown_Click(object sender, EventArgs e)
{
MoveSelectedRule(1);
}
private void MoveSelectedRule(int offset)
{
int index = ruleList.SelectedIndex;
int newIndex = index + offset;
if (index < 0 || newIndex < 0 || newIndex >= rules.Count)
{
return;
}
LogColorRule rule = rules[index];
rules.RemoveAt(index);
rules.Insert(newIndex, rule);
RefreshRuleList(newIndex);
RefreshPreview();
}
private void RestoreDefaults_Click(object sender, EventArgs e)
{
rules.Clear();
rules.AddRange(LogColorRule.CreateDefaults());
RefreshRuleList(0);
RefreshPreview();
}
private void RefreshPreview()
{
int selectionStart = previewBox.SelectionStart;
int selectionLength = previewBox.SelectionLength;
string text = previewBox.Text;
LogColorizer.Apply(previewBox, 0, text.Length, text, rules, previewBox.Font, previewBoldFont);
previewBox.Select(Math.Min(selectionStart, previewBox.TextLength), Math.Min(selectionLength, Math.Max(0, previewBox.TextLength - selectionStart)));
}
}
}
+32
View File
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AppDiagnostic
{
public class DiagApi
{
private static MainForm diagWindow; // Udržiava referenciu na existujúce okno
public DiagApi()
{
if (diagWindow == null || diagWindow.IsDisposed) // Ak okno neexistuje, vytvoríme ho
{
diagWindow = new MainForm();
diagWindow.FormClosing += (s, e) =>
{
diagWindow = null; // Keď sa zavrie, vyčistíme referenciu
};
diagWindow.Show();
}
else
{
diagWindow.BringToFront(); // Ak už beží, len ho presunieme na vrch
diagWindow.WindowState = FormWindowState.Normal; // Ak je minimalizované, obnovíme ho
}
}
}
}
+24
View File
@@ -0,0 +1,24 @@
using AppDiagnostic.Logging;
using System;
namespace AppDiagnostic
{
public static class DiagnosticLogFormatter
{
public static string Format(DiagnosticLogEntry entry)
{
if (entry == null)
{
return string.Empty;
}
string level = (entry.Level ?? string.Empty).ToUpperInvariant().PadRight(5);
string application = string.IsNullOrWhiteSpace(entry.ApplicationName) ? "Unknown" : entry.ApplicationName;
string logger = entry.LoggerName ?? string.Empty;
string message = entry.Message ?? string.Empty;
string exception = string.IsNullOrWhiteSpace(entry.Exception) ? string.Empty : Environment.NewLine + entry.Exception;
return $"{entry.TimestampUtc.ToLocalTime():yyyy-MM-dd HH:mm:ss.fff}|{level}|{application}[{entry.ProcessId}]|{logger}|{message}{exception}";
}
}
}
+82
View File
@@ -0,0 +1,82 @@
using AppDiagnostic.Logging;
using System.Collections.Generic;
using System.Linq;
namespace AppDiagnostic
{
public sealed class DiagnosticLogStore
{
private const int MaximumLogCount = 10000;
private static readonly DiagnosticLogStore instance = new DiagnosticLogStore();
private readonly object syncRoot = new object();
private readonly List<DiagnosticLogEntry> entries = new List<DiagnosticLogEntry>();
private long totalReceived;
private long version;
private DiagnosticLogStore()
{
}
public static DiagnosticLogStore Instance => instance;
public long TotalReceived
{
get
{
lock (syncRoot)
{
return totalReceived;
}
}
}
public long Version
{
get
{
lock (syncRoot)
{
return version;
}
}
}
public void Add(DiagnosticLogEntry entry)
{
if (entry == null)
{
return;
}
lock (syncRoot)
{
entries.Add(entry);
totalReceived++;
version++;
int excessCount = entries.Count - MaximumLogCount;
if (excessCount > 0)
{
entries.RemoveRange(0, excessCount);
}
}
}
public List<DiagnosticLogEntry> GetSnapshot()
{
lock (syncRoot)
{
return entries.ToList();
}
}
public void Clear()
{
lock (syncRoot)
{
entries.Clear();
version++;
}
}
}
}
+164
View File
@@ -0,0 +1,164 @@
using AppDiagnostic.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
namespace AppDiagnostic
{
public sealed class DiagnosticPipeServer : IDisposable
{
private readonly Action<DiagnosticLogEntry> messageReceived;
private readonly CancellationTokenSource cancellation = new CancellationTokenSource();
private readonly object syncRoot = new object();
private readonly List<NamedPipeServerStream> connectedClients = new List<NamedPipeServerStream>();
private NamedPipeServerStream waitingServer;
private Task serverTask;
public DiagnosticPipeServer(Action<DiagnosticLogEntry> messageReceived)
{
this.messageReceived = messageReceived ?? throw new ArgumentNullException(nameof(messageReceived));
}
public int ConnectedClientCount
{
get
{
lock (syncRoot)
{
return connectedClients.Count;
}
}
}
public void Start()
{
if (serverTask != null)
{
return;
}
serverTask = Task.Run((Action)AcceptConnections);
}
private void AcceptConnections()
{
while (!cancellation.IsCancellationRequested)
{
NamedPipeServerStream server = null;
try
{
server = new NamedPipeServerStream(DiagnosticProtocol.DefaultPipeName, PipeDirection.In, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
lock (syncRoot)
{
waitingServer = server;
}
server.WaitForConnection();
lock (syncRoot)
{
waitingServer = null;
connectedClients.Add(server);
}
NamedPipeServerStream connectedServer = server;
server = null;
Task.Run(() => ReadClient(connectedServer));
}
catch (ObjectDisposedException)
{
if (!cancellation.IsCancellationRequested)
{
throw;
}
}
catch (IOException)
{
if (!cancellation.IsCancellationRequested)
{
Thread.Sleep(250);
}
}
finally
{
lock (syncRoot)
{
if (ReferenceEquals(waitingServer, server))
{
waitingServer = null;
}
}
server?.Dispose();
}
}
}
private void ReadClient(NamedPipeServerStream client)
{
try
{
while (client.IsConnected && !cancellation.IsCancellationRequested)
{
DiagnosticLogEntry entry = DiagnosticMessageSerializer.ReadFramed(client);
messageReceived(entry);
}
}
catch (EndOfStreamException)
{
// The producer application was closed.
}
catch (IOException)
{
// The producer application disconnected.
}
catch (ObjectDisposedException)
{
// The diagnostic application is shutting down.
}
finally
{
lock (syncRoot)
{
connectedClients.Remove(client);
}
client.Dispose();
}
}
public void Dispose()
{
cancellation.Cancel();
lock (syncRoot)
{
waitingServer?.Dispose();
waitingServer = null;
foreach (NamedPipeServerStream client in connectedClients.ToArray())
{
client.Dispose();
}
connectedClients.Clear();
}
try
{
serverTask?.Wait(2000);
}
catch (AggregateException)
{
// Cancellation during shutdown is expected.
}
cancellation.Dispose();
}
}
}
+174
View File
@@ -0,0 +1,174 @@
using SharedComponents;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AppDiagnostic
{
public class LogAdapter
{
private ListView _listView;
public string _filterText = string.Empty;
private bool _isUserScrolling = false; // Indikátor, že používateľ manuálne scrolluje
private bool _autoScrollEnabled = true; // Indikátor, že automatické scrollovanie je povolené
private Timer _refreshTimer;
private const int RefreshInterval = 1000;
public LogAdapter(ListView listView)
{
_listView = listView;
// Nastavenie ListView
_listView.View = View.Details;
_listView.Columns.Clear();
_listView.Columns.Add("Logs");
_listView.Scrollable = true;
// Nastavenie šírky stĺpca na celú šírku ListView
AdjustColumnWidth();
// Udalosť pre dynamickú zmenu veľkosti stĺpca pri zmene veľkosti ListView
_listView.Resize += (sender, args) => AdjustColumnWidth();
// Pridanie udalosti pre manuálne skrolovanie
_listView.MouseWheel += ListView_MouseWheel;
// Inicializácia časovača na pravidelný refresh
_refreshTimer = new Timer { Interval = RefreshInterval };
_refreshTimer.Tick += (sender, args) => RefreshListView();
_refreshTimer.Start();
}
private void ListView_MouseWheel(object sender, MouseEventArgs e)
{
_isUserScrolling = true;
// Ak sa manuálnym scrollovaním používateľ dostane na koniec, obnovíme automatické scrollovanie
if (IsOnLastItem())
{
_isUserScrolling = false;
_autoScrollEnabled = true;
}
else
{
_autoScrollEnabled = false;
}
}
public void RefreshListView()
{
//LiveLogCache.Instance.AddLog(string.Format("-------------------------------RunDeviceAfter()-------------------------------"));
if (_listView.InvokeRequired)
{
_listView.Invoke(new Action(RefreshListView));
return;
}
_listView.BeginUpdate();
try
{
// Získanie pozície prvého viditeľného prvku pre stabilizáciu scrollovania
int topIndexBeforeRefresh = _listView.TopItem?.Index ?? 0;
// Pred pridaním nových položiek si pamätáme, či bol používateľ na poslednej položke
bool wasOnLastItem = IsOnLastItem();
// Uchovanie aktuálne označených položiek (indexov)
var selectedIndices = _listView.SelectedIndices.Cast<int>().ToList();
// Načítanie logov
var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount())
.Where(log => string.IsNullOrEmpty(_filterText) ||
log.IndexOf(_filterText, StringComparison.OrdinalIgnoreCase) >= 0)
.ToList();
// Vymazanie existujúcich položiek a pridanie nových
_listView.Items.Clear();
foreach (var log in logs)
{
var item = new ListViewItem(log)
{
BackColor = _listView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240)
};
_listView.Items.Add(item);
}
// Obnovenie označených položiek
foreach (var index in selectedIndices)
{
if (index < _listView.Items.Count)
{
_listView.Items[index].Selected = true;
}
}
// Ak bol používateľ na poslednom prvku, nastavíme focus a scroll na posledný prvok
if (_autoScrollEnabled && wasOnLastItem && _listView.Items.Count > 0)
{
var lastItemIndex = _listView.Items.Count - 1;
_listView.EnsureVisible(lastItemIndex);
_listView.Items[lastItemIndex].Focused = true;
}
else
{
// Ak používateľ nebol na spodku, vrátime sa na predchádzajúcu pozíciu scrollu
if (topIndexBeforeRefresh < _listView.Items.Count)
{
_listView.TopItem = _listView.Items[topIndexBeforeRefresh];
}
}
}
finally
{
_listView.EndUpdate();
}
}
public void ApplyFilter(string filterText)
{
_filterText = filterText?.Trim() ?? string.Empty;
RefreshListView();
}
private bool IsOnLastItem()
{
if (_listView.Items.Count == 0)
return false;
// Získame poslednú položku
int lastItemIndex = _listView.Items.Count - 1;
var lastItem = _listView.Items[lastItemIndex];
// Overíme, či je posledná položka úplne viditeľná
return lastItem.Bounds.Bottom <= _listView.ClientRectangle.Bottom;
}
public void EnableAutoScroll()
{
_autoScrollEnabled = true;
}
public void DisableAutoScroll()
{
_autoScrollEnabled = false;
}
private void AdjustColumnWidth()
{
if (_listView.Columns.Count > 0)
{
_listView.Columns[0].Width = _listView.ClientSize.Width;
}
}
}
}
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Drawing;
namespace AppDiagnostic
{
[Serializable]
public sealed class LogColorRule
{
public bool Enabled { get; set; } = true;
public string Pattern { get; set; } = string.Empty;
public int ForeColorArgb { get; set; } = Color.Black.ToArgb();
public int BackColorArgb { get; set; }
public bool UseBackColor { get; set; }
public bool Bold { get; set; }
public Color ForeColor => Color.FromArgb(ForeColorArgb);
public Color BackColor => Color.FromArgb(BackColorArgb);
public LogColorRule Clone()
{
return new LogColorRule
{
Enabled = Enabled,
Pattern = Pattern,
ForeColorArgb = ForeColorArgb,
BackColorArgb = BackColorArgb,
UseBackColor = UseBackColor,
Bold = Bold
};
}
public override string ToString()
{
string state = Enabled ? string.Empty : "[disabled] ";
return state + Pattern;
}
public static List<LogColorRule> CreateDefaults()
{
return new List<LogColorRule>
{
Create("|TRACE|", Color.DimGray, false),
Create("|DEBUG|", Color.RoyalBlue, false),
Create("|INFO |", Color.ForestGreen, false),
Create("|WARN |", Color.DarkOrange, true),
Create("|ERROR|", Color.Crimson, true),
Create("|FATAL|", Color.White, true, Color.DarkRed)
};
}
private static LogColorRule Create(string pattern, Color foreground, bool bold, Color? background = null)
{
return new LogColorRule
{
Enabled = true,
Pattern = pattern,
ForeColorArgb = foreground.ToArgb(),
BackColorArgb = background?.ToArgb() ?? Color.Empty.ToArgb(),
UseBackColor = background.HasValue,
Bold = bold
};
}
}
}
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
namespace AppDiagnostic
{
public static class LogColorRuleRepository
{
private static readonly string settingsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Sensus", "AppDiagnostic");
private static readonly string settingsPath = Path.Combine(settingsFolder, "color-rules.xml");
public static List<LogColorRule> Load()
{
try
{
if (!File.Exists(settingsPath))
{
return LogColorRule.CreateDefaults();
}
var serializer = new XmlSerializer(typeof(List<LogColorRule>));
using (FileStream stream = File.OpenRead(settingsPath))
{
var rules = serializer.Deserialize(stream) as List<LogColorRule>;
return rules == null || rules.Count == 0 ? LogColorRule.CreateDefaults() : rules;
}
}
catch
{
return LogColorRule.CreateDefaults();
}
}
public static void Save(IEnumerable<LogColorRule> rules)
{
Directory.CreateDirectory(settingsFolder);
var serializer = new XmlSerializer(typeof(List<LogColorRule>));
using (FileStream stream = File.Create(settingsPath))
{
serializer.Serialize(stream, new List<LogColorRule>(rules));
}
}
}
}
+47
View File
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace AppDiagnostic
{
public static class LogColorizer
{
public static void Apply(RichTextBox target, int startIndex, int length, string text, IEnumerable<LogColorRule> rules, Font regularFont, Font boldFont)
{
if (target == null || length <= 0)
{
return;
}
target.Select(startIndex, length);
target.SelectionColor = target.ForeColor;
target.SelectionBackColor = target.BackColor;
target.SelectionFont = regularFont;
foreach (LogColorRule rule in rules)
{
if (rule == null || !rule.Enabled || string.IsNullOrEmpty(rule.Pattern))
{
continue;
}
int searchIndex = 0;
while (searchIndex < text.Length)
{
int matchIndex = text.IndexOf(rule.Pattern, searchIndex, StringComparison.OrdinalIgnoreCase);
if (matchIndex < 0)
{
break;
}
target.Select(startIndex + matchIndex, rule.Pattern.Length);
target.SelectionColor = rule.ForeColor;
target.SelectionBackColor = rule.UseBackColor ? rule.BackColor : target.BackColor;
target.SelectionFont = rule.Bold ? boldFont : regularFont;
searchIndex = matchIndex + rule.Pattern.Length;
}
}
}
}
}
+91
View File
@@ -0,0 +1,91 @@
using SharedComponents;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AppDiagnostic
{
public class LogFilter
{
private ListView _listView;
private string _filterText = string.Empty; // Pre uloženie aktuálneho filtrovaného reťazca
// Konstruktor
public LogFilter(ListView listView)
{
_listView = listView;
}
// Metóda na aplikovanie filtra na ListView
public void ApplyFilter(string filterText)
{
_filterText = filterText.ToLower(); // Ukladáme text filtra bez ohľadu na veľkosť písmen
// Po aplikovaní filtra obnovíme zobrazenie
RefreshListView();
}
public void RefreshListView()
{
try
{
// Skontrolujeme, či sme na hlavnom vlákne a v prípade potreby použijeme Invoke
if (_listView.InvokeRequired)
{
// Použijeme Invoke, ak nie sme na hlavnom vlákne
_listView.Invoke(new Action(RefreshListView));
}
else
{
// Vymazanie existujúcich položiek
_listView.Items.Clear();
// Načítame všetky logy (ideálne z cache alebo databázy)
var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.Logs.Count);
// Pridáme len tie logy, ktoré spĺňajú filter
foreach (var log in logs)
{
if (log.ToLower().Contains(_filterText)) // Kontrola, či log obsahuje filter text
{
var listViewItem = new ListViewItem(log);
// Striedanie farieb riadkov
if (_listView.Items.Count % 2 == 0) // Párny index => biela
{
listViewItem.BackColor = Color.White;
}
else // Nepárny index => svetlá sivá
{
listViewItem.BackColor = Color.FromArgb(240, 240, 240); // Veľmi svetlá sivá
}
// Pridanie efektu pre novú položku
ApplyNewItemEffect(listViewItem);
// Pridanie položky do ListView
_listView.Items.Add(listViewItem);
}
}
}
}
catch (Exception ex)
{
// Zachytíme výnimku, ak sa niečo pokazí, a zobrazíme ju užívateľovi
MessageBox.Show($"An error occurred while refreshing the log view: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// Môžete pridať ďalšie metódy na zobrazenie alebo efekt pre nové položky, ak je to potrebné
private void ApplyNewItemEffect(ListViewItem item)
{
// Prípadný efekt pre nový pridaný log
// Môžete pridať animáciu alebo zmenu farby atď.
item.ForeColor = Color.Green; // Napríklad zmeníme farbu písma na zelenú
}
}
}
+309
View File
@@ -0,0 +1,309 @@
namespace AppDiagnostic
{
partial class MainForm
{
private System.ComponentModel.IContainer components = null;
private System.Windows.Forms.ToolStrip mainToolStrip;
private System.Windows.Forms.ToolStripButton pauseButton;
private System.Windows.Forms.ToolStripButton refreshButton;
private System.Windows.Forms.ToolStripButton clearButton;
private System.Windows.Forms.ToolStripButton saveButton;
private System.Windows.Forms.ToolStripButton copyButton;
private System.Windows.Forms.ToolStripButton copyAllButton;
private System.Windows.Forms.ToolStripButton wrapButton;
private System.Windows.Forms.ToolStripButton autoScrollButton;
private System.Windows.Forms.ToolStripButton alwaysOnTopButton;
private System.Windows.Forms.ToolStripButton colorRulesButton;
private System.Windows.Forms.ToolStripButton closeButton;
private System.Windows.Forms.TableLayoutPanel filterPanel;
private System.Windows.Forms.Label filterLabel;
private System.Windows.Forms.TextBox filterTextBox;
private System.Windows.Forms.Label levelLabel;
private System.Windows.Forms.ComboBox levelComboBox;
private System.Windows.Forms.Label applicationLabel;
private System.Windows.Forms.ComboBox applicationComboBox;
private System.Windows.Forms.Button applyFilterButton;
private System.Windows.Forms.Button clearFilterButton;
private System.Windows.Forms.RichTextBox logView;
private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.ToolStripStatusLabel receiverStatusLabel;
private System.Windows.Forms.ToolStripStatusLabel statusSpacer;
private System.Windows.Forms.ToolStripStatusLabel countStatusLabel;
private System.Windows.Forms.ContextMenuStrip logContextMenu;
private System.Windows.Forms.ToolStripMenuItem copySelectionMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyLineMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyAllMenuItem;
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.mainToolStrip = new System.Windows.Forms.ToolStrip();
this.pauseButton = new System.Windows.Forms.ToolStripButton();
this.refreshButton = new System.Windows.Forms.ToolStripButton();
this.clearButton = new System.Windows.Forms.ToolStripButton();
this.saveButton = new System.Windows.Forms.ToolStripButton();
this.copyButton = new System.Windows.Forms.ToolStripButton();
this.copyAllButton = new System.Windows.Forms.ToolStripButton();
this.wrapButton = new System.Windows.Forms.ToolStripButton();
this.autoScrollButton = new System.Windows.Forms.ToolStripButton();
this.alwaysOnTopButton = new System.Windows.Forms.ToolStripButton();
this.colorRulesButton = new System.Windows.Forms.ToolStripButton();
this.closeButton = new System.Windows.Forms.ToolStripButton();
this.filterPanel = new System.Windows.Forms.TableLayoutPanel();
this.filterLabel = new System.Windows.Forms.Label();
this.filterTextBox = new System.Windows.Forms.TextBox();
this.levelLabel = new System.Windows.Forms.Label();
this.levelComboBox = new System.Windows.Forms.ComboBox();
this.applicationLabel = new System.Windows.Forms.Label();
this.applicationComboBox = new System.Windows.Forms.ComboBox();
this.applyFilterButton = new System.Windows.Forms.Button();
this.clearFilterButton = new System.Windows.Forms.Button();
this.logContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.copySelectionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyLineMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyAllMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.logView = new System.Windows.Forms.RichTextBox();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.receiverStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.statusSpacer = new System.Windows.Forms.ToolStripStatusLabel();
this.countStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.mainToolStrip.SuspendLayout();
this.filterPanel.SuspendLayout();
this.logContextMenu.SuspendLayout();
this.statusStrip.SuspendLayout();
this.SuspendLayout();
//
// mainToolStrip
//
this.mainToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.pauseButton,
this.refreshButton,
this.clearButton,
this.saveButton,
new System.Windows.Forms.ToolStripSeparator(),
this.copyButton,
this.copyAllButton,
new System.Windows.Forms.ToolStripSeparator(),
this.wrapButton,
this.autoScrollButton,
this.alwaysOnTopButton,
this.colorRulesButton,
this.closeButton});
this.mainToolStrip.Location = new System.Drawing.Point(0, 0);
this.mainToolStrip.Name = "mainToolStrip";
this.mainToolStrip.Padding = new System.Windows.Forms.Padding(6, 3, 6, 3);
this.mainToolStrip.Size = new System.Drawing.Size(1184, 31);
this.mainToolStrip.TabIndex = 0;
//
// pauseButton
//
this.pauseButton.CheckOnClick = true;
this.pauseButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.pauseButton.Text = "Pause";
this.pauseButton.ToolTipText = "Pause screen updates while continuing to receive logs";
this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);
//
// refreshButton
//
this.refreshButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.refreshButton.Text = "Refresh";
this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
//
// clearButton
//
this.clearButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.clearButton.Text = "Clear";
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
//
// saveButton
//
this.saveButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.saveButton.Text = "Save...";
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
//
// copyButton
//
this.copyButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.copyButton.Text = "Copy";
this.copyButton.ToolTipText = "Copy selected text or the current log line";
this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
//
// copyAllButton
//
this.copyAllButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.copyAllButton.Text = "Copy all";
this.copyAllButton.Click += new System.EventHandler(this.copyAllButton_Click);
//
// wrapButton
//
this.wrapButton.Checked = true;
this.wrapButton.CheckOnClick = true;
this.wrapButton.CheckState = System.Windows.Forms.CheckState.Checked;
this.wrapButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.wrapButton.Text = "Wrap lines";
this.wrapButton.Click += new System.EventHandler(this.wrapButton_Click);
//
// autoScrollButton
//
this.autoScrollButton.Checked = true;
this.autoScrollButton.CheckOnClick = true;
this.autoScrollButton.CheckState = System.Windows.Forms.CheckState.Checked;
this.autoScrollButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.autoScrollButton.Text = "Auto-scroll";
//
// alwaysOnTopButton
//
this.alwaysOnTopButton.CheckOnClick = true;
this.alwaysOnTopButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.alwaysOnTopButton.Text = "Always on top";
this.alwaysOnTopButton.Click += new System.EventHandler(this.alwaysOnTopButton_Click);
//
// colorRulesButton
//
this.colorRulesButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.colorRulesButton.Text = "Color rules...";
this.colorRulesButton.Click += new System.EventHandler(this.colorRulesButton_Click);
//
// closeButton
//
this.closeButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.closeButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.closeButton.Text = "Close";
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
//
// filterPanel
//
this.filterPanel.ColumnCount = 8;
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 42F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 42F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 105F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 72F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 180F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 66F));
this.filterPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 66F));
this.filterPanel.Controls.Add(this.filterLabel, 0, 0);
this.filterPanel.Controls.Add(this.filterTextBox, 1, 0);
this.filterPanel.Controls.Add(this.levelLabel, 2, 0);
this.filterPanel.Controls.Add(this.levelComboBox, 3, 0);
this.filterPanel.Controls.Add(this.applicationLabel, 4, 0);
this.filterPanel.Controls.Add(this.applicationComboBox, 5, 0);
this.filterPanel.Controls.Add(this.applyFilterButton, 6, 0);
this.filterPanel.Controls.Add(this.clearFilterButton, 7, 0);
this.filterPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.filterPanel.Location = new System.Drawing.Point(0, 31);
this.filterPanel.Name = "filterPanel";
this.filterPanel.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.filterPanel.RowCount = 1;
this.filterPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.filterPanel.Size = new System.Drawing.Size(1184, 38);
this.filterPanel.TabIndex = 1;
//
// filter controls
//
this.filterLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.filterLabel.AutoSize = true;
this.filterLabel.Text = "Filter";
this.filterTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.filterTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.filterTextBox_KeyDown);
this.levelLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.levelLabel.AutoSize = true;
this.levelLabel.Text = "Level";
this.levelComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.levelComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.levelComboBox.SelectedIndexChanged += new System.EventHandler(this.filterValueChanged);
this.applicationLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.applicationLabel.AutoSize = true;
this.applicationLabel.Text = "Application";
this.applicationComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.applicationComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.applicationComboBox.SelectedIndexChanged += new System.EventHandler(this.filterValueChanged);
this.applyFilterButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.applyFilterButton.Text = "Apply";
this.applyFilterButton.Click += new System.EventHandler(this.applyFilterButton_Click);
this.clearFilterButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.clearFilterButton.Text = "Reset";
this.clearFilterButton.Click += new System.EventHandler(this.clearFilterButton_Click);
//
// logContextMenu
//
this.logContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copySelectionMenuItem,
this.copyLineMenuItem,
this.copyAllMenuItem});
this.copySelectionMenuItem.Text = "Copy selection";
this.copySelectionMenuItem.Click += new System.EventHandler(this.copySelectionMenuItem_Click);
this.copyLineMenuItem.Text = "Copy current line";
this.copyLineMenuItem.Click += new System.EventHandler(this.copyLineMenuItem_Click);
this.copyAllMenuItem.Text = "Copy all visible logs";
this.copyAllMenuItem.Click += new System.EventHandler(this.copyAllButton_Click);
//
// logView
//
this.logView.BackColor = System.Drawing.SystemColors.Window;
this.logView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.logView.ContextMenuStrip = this.logContextMenu;
this.logView.DetectUrls = false;
this.logView.Dock = System.Windows.Forms.DockStyle.Fill;
this.logView.Font = new System.Drawing.Font("Consolas", 9F);
this.logView.HideSelection = false;
this.logView.Location = new System.Drawing.Point(0, 69);
this.logView.Name = "logView";
this.logView.ReadOnly = true;
this.logView.Size = new System.Drawing.Size(1184, 554);
this.logView.TabIndex = 2;
this.logView.Text = "";
this.logView.WordWrap = true;
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.receiverStatusLabel,
this.statusSpacer,
this.countStatusLabel});
this.statusStrip.Location = new System.Drawing.Point(0, 623);
this.statusStrip.Name = "statusStrip";
this.statusStrip.Size = new System.Drawing.Size(1184, 22);
this.statusStrip.TabIndex = 3;
this.receiverStatusLabel.Text = "Listening";
this.statusSpacer.Spring = true;
this.countStatusLabel.Text = "Received: 0 | Visible: 0";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1184, 645);
this.Controls.Add(this.logView);
this.Controls.Add(this.filterPanel);
this.Controls.Add(this.mainToolStrip);
this.Controls.Add(this.statusStrip);
this.KeyPreview = true;
this.MinimumSize = new System.Drawing.Size(860, 480);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Application live diagnostic";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown);
this.mainToolStrip.ResumeLayout(false);
this.mainToolStrip.PerformLayout();
this.filterPanel.ResumeLayout(false);
this.filterPanel.PerformLayout();
this.logContextMenu.ResumeLayout(false);
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
}
}
+446
View File
@@ -0,0 +1,446 @@
using AppDiagnostic.Logging;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace AppDiagnostic
{
public partial class MainForm : Form
{
private readonly Func<int> connectedClientCountProvider;
private readonly Func<bool> activationRequestProvider;
private readonly Timer refreshTimer;
private readonly Font regularLogFont;
private readonly Font boldLogFont;
private List<LogColorRule> colorRules;
private long lastRenderedVersion = -1;
private int observedEntryCount;
private int visibleEntryCount;
private bool loadingFilters;
public MainForm() : this(null, null)
{
}
public MainForm(Func<int> connectedClientCountProvider, Func<bool> activationRequestProvider)
{
this.connectedClientCountProvider = connectedClientCountProvider;
this.activationRequestProvider = activationRequestProvider;
InitializeComponent();
Icon = Properties.Resources.TBF_icon;
regularLogFont = new Font(logView.Font, FontStyle.Regular);
boldLogFont = new Font(logView.Font, FontStyle.Bold);
colorRules = LogColorRuleRepository.Load();
InitializeFilters();
refreshTimer = new Timer { Interval = 250 };
refreshTimer.Tick += refreshTimer_Tick;
refreshTimer.Start();
RefreshView(true);
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
refreshTimer.Stop();
refreshTimer.Dispose();
regularLogFont.Dispose();
boldLogFont.Dispose();
base.OnFormClosing(e);
}
private void InitializeFilters()
{
loadingFilters = true;
levelComboBox.Items.AddRange(new object[] { "All levels", "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL" });
levelComboBox.SelectedIndex = 0;
applicationComboBox.Items.Add("All applications");
applicationComboBox.SelectedIndex = 0;
loadingFilters = false;
}
private void refreshTimer_Tick(object sender, EventArgs e)
{
ProcessActivationRequest();
RefreshView(false);
}
private void ProcessActivationRequest()
{
if (activationRequestProvider == null || !activationRequestProvider())
{
return;
}
if (WindowState == FormWindowState.Minimized)
{
WindowState = FormWindowState.Normal;
}
Show();
BringToFront();
Activate();
}
private void RefreshView(bool forceFullRefresh)
{
List<DiagnosticLogEntry> snapshot = DiagnosticLogStore.Instance.GetSnapshot();
UpdateApplicationFilter(snapshot);
if (pauseButton.Checked)
{
UpdateStatus(snapshot.Count);
return;
}
long currentVersion = DiagnosticLogStore.Instance.Version;
if (!forceFullRefresh && currentVersion == lastRenderedVersion)
{
UpdateStatus(snapshot.Count);
return;
}
bool canAppend = !forceFullRefresh && snapshot.Count > observedEntryCount;
if (canAppend)
{
AppendEntries(snapshot.Skip(observedEntryCount));
}
else
{
RebuildView(snapshot);
}
observedEntryCount = snapshot.Count;
lastRenderedVersion = currentVersion;
UpdateStatus(snapshot.Count);
}
private void RebuildView(IEnumerable<DiagnosticLogEntry> entries)
{
logView.SuspendLayout();
logView.Clear();
visibleEntryCount = 0;
AppendEntries(entries, false);
logView.ResumeLayout();
if (autoScrollButton.Checked)
{
ScrollToEnd();
}
}
private void AppendEntries(IEnumerable<DiagnosticLogEntry> entries, bool scrollAfterAppend = true)
{
int originalSelectionStart = logView.SelectionStart;
int originalSelectionLength = logView.SelectionLength;
foreach (DiagnosticLogEntry entry in entries)
{
if (!MatchesFilter(entry))
{
continue;
}
AppendEntry(entry);
visibleEntryCount++;
}
if (scrollAfterAppend && autoScrollButton.Checked)
{
ScrollToEnd();
}
else if (!autoScrollButton.Checked)
{
int safeStart = Math.Min(originalSelectionStart, logView.TextLength);
int safeLength = Math.Min(originalSelectionLength, logView.TextLength - safeStart);
logView.Select(safeStart, safeLength);
}
}
private void AppendEntry(DiagnosticLogEntry entry)
{
string text = DiagnosticLogFormatter.Format(entry);
if (logView.TextLength > 0)
{
logView.AppendText(Environment.NewLine);
}
int startIndex = logView.TextLength;
logView.AppendText(text);
LogColorizer.Apply(logView, startIndex, text.Length, text, colorRules, regularLogFont, boldLogFont);
logView.Select(logView.TextLength, 0);
}
private bool MatchesFilter(DiagnosticLogEntry entry)
{
string selectedLevel = levelComboBox.SelectedItem as string;
if (!string.IsNullOrEmpty(selectedLevel) && selectedLevel != "All levels" && !string.Equals(entry.Level, selectedLevel, StringComparison.OrdinalIgnoreCase))
{
return false;
}
string selectedApplication = applicationComboBox.SelectedItem as string;
if (!string.IsNullOrEmpty(selectedApplication) && selectedApplication != "All applications" && !string.Equals(entry.ApplicationName, selectedApplication, StringComparison.OrdinalIgnoreCase))
{
return false;
}
string filter = filterTextBox.Text.Trim();
return filter.Length == 0 || DiagnosticLogFormatter.Format(entry).IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0;
}
private void UpdateApplicationFilter(IEnumerable<DiagnosticLogEntry> entries)
{
string selectedApplication = applicationComboBox.SelectedItem as string ?? "All applications";
List<string> applications = entries.Select(entry => entry.ApplicationName).Where(name => !string.IsNullOrWhiteSpace(name)).Distinct(StringComparer.OrdinalIgnoreCase).OrderBy(name => name).ToList();
List<string> currentApplications = applicationComboBox.Items.Cast<string>().Skip(1).ToList();
if (applications.SequenceEqual(currentApplications, StringComparer.OrdinalIgnoreCase))
{
return;
}
loadingFilters = true;
applicationComboBox.BeginUpdate();
applicationComboBox.Items.Clear();
applicationComboBox.Items.Add("All applications");
applicationComboBox.Items.AddRange(applications.Cast<object>().ToArray());
applicationComboBox.SelectedItem = applicationComboBox.Items.Cast<string>().FirstOrDefault(item => string.Equals(item, selectedApplication, StringComparison.OrdinalIgnoreCase)) ?? "All applications";
applicationComboBox.EndUpdate();
loadingFilters = false;
}
private void UpdateStatus(int storedCount)
{
int clients = connectedClientCountProvider?.Invoke() ?? 0;
receiverStatusLabel.Text = pauseButton.Checked ? $"Paused | Connected sources: {clients}" : $"Listening | Connected sources: {clients}";
countStatusLabel.Text = $"Received: {DiagnosticLogStore.Instance.TotalReceived:N0} | Stored: {storedCount:N0} | Visible: {visibleEntryCount:N0}";
}
private void ScrollToEnd()
{
logView.Select(logView.TextLength, 0);
logView.ScrollToCaret();
}
private void pauseButton_Click(object sender, EventArgs e)
{
pauseButton.Text = pauseButton.Checked ? "Resume" : "Pause";
if (!pauseButton.Checked)
{
RefreshView(true);
}
else
{
UpdateStatus(DiagnosticLogStore.Instance.GetSnapshot().Count);
}
}
private void refreshButton_Click(object sender, EventArgs e)
{
RefreshView(true);
}
private void clearButton_Click(object sender, EventArgs e)
{
DiagnosticLogStore.Instance.Clear();
observedEntryCount = 0;
visibleEntryCount = 0;
RefreshView(true);
}
private void saveButton_Click(object sender, EventArgs e)
{
using (var dialog = new SaveFileDialog())
{
dialog.Filter = "Text files (*.txt)|*.txt|Log files (*.log)|*.log|All files (*.*)|*.*";
dialog.Title = "Save visible diagnostic logs";
dialog.DefaultExt = "log";
dialog.FileName = $"AppDiagnostic_{DateTime.Now:yyyyMMdd_HHmmss}.log";
if (dialog.ShowDialog(this) != DialogResult.OK)
{
return;
}
try
{
File.WriteAllText(dialog.FileName, logView.Text);
}
catch (Exception exception)
{
MessageBox.Show(this, $"Unable to save diagnostic logs: {exception.Message}", "Save error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void copyButton_Click(object sender, EventArgs e)
{
CopySelectionOrCurrentLine();
}
private void copySelectionMenuItem_Click(object sender, EventArgs e)
{
if (logView.SelectionLength > 0)
{
CopyText(logView.SelectedText);
}
}
private void copyLineMenuItem_Click(object sender, EventArgs e)
{
CopyCurrentLine();
}
private void copyAllButton_Click(object sender, EventArgs e)
{
CopyText(logView.Text);
}
private void CopySelectionOrCurrentLine()
{
if (logView.SelectionLength > 0)
{
CopyText(logView.SelectedText);
}
else
{
CopyCurrentLine();
}
}
private void CopyCurrentLine()
{
if (logView.Lines.Length == 0)
{
return;
}
int lineIndex = logView.GetLineFromCharIndex(logView.SelectionStart);
if (lineIndex >= 0 && lineIndex < logView.Lines.Length)
{
CopyText(logView.Lines[lineIndex]);
}
}
private void CopyText(string text)
{
if (string.IsNullOrEmpty(text))
{
return;
}
try
{
Clipboard.SetText(text);
}
catch (Exception exception)
{
MessageBox.Show(this, $"Unable to copy text: {exception.Message}", "Clipboard error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void wrapButton_Click(object sender, EventArgs e)
{
logView.WordWrap = wrapButton.Checked;
}
private void alwaysOnTopButton_Click(object sender, EventArgs e)
{
TopMost = alwaysOnTopButton.Checked;
}
private void colorRulesButton_Click(object sender, EventArgs e)
{
using (var editor = new ColorRuleEditorForm(colorRules))
{
if (editor.ShowDialog(this) != DialogResult.OK)
{
return;
}
colorRules = editor.Rules;
try
{
LogColorRuleRepository.Save(colorRules);
}
catch (Exception exception)
{
MessageBox.Show(this, $"Unable to save color rules: {exception.Message}", "Settings error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
RefreshView(true);
}
}
private void applyFilterButton_Click(object sender, EventArgs e)
{
RefreshView(true);
}
private void clearFilterButton_Click(object sender, EventArgs e)
{
loadingFilters = true;
filterTextBox.Clear();
levelComboBox.SelectedIndex = 0;
applicationComboBox.SelectedIndex = 0;
loadingFilters = false;
RefreshView(true);
}
private void filterValueChanged(object sender, EventArgs e)
{
if (!loadingFilters)
{
RefreshView(true);
}
}
private void filterTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
RefreshView(true);
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.Escape)
{
clearFilterButton_Click(sender, EventArgs.Empty);
e.SuppressKeyPress = true;
}
}
private void closeButton_Click(object sender, EventArgs e)
{
Close();
}
private void MainForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.F)
{
filterTextBox.Focus();
filterTextBox.SelectAll();
e.SuppressKeyPress = true;
}
else if (e.Control && e.KeyCode == Keys.S)
{
saveButton_Click(sender, EventArgs.Empty);
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.F5)
{
RefreshView(true);
e.SuppressKeyPress = true;
}
}
}
}
+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=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>
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AppDiagnostic
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
bool isFirstInstance;
using (var instanceMutex = new Mutex(true, "Sensus.AppDiagnostic.SingleInstance", out isFirstInstance))
using (var activationEvent = new EventWaitHandle(false, EventResetMode.AutoReset, "Sensus.AppDiagnostic.Activate"))
{
if (!isFirstInstance)
{
activationEvent.Set();
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (var diagnosticServer = new DiagnosticPipeServer(DiagnosticLogStore.Instance.Add))
{
diagnosticServer.Start();
Application.Run(new MainForm(() => diagnosticServer.ConnectedClientCount, () => activationEvent.WaitOne(0)));
}
}
}
}
}
+33
View File
@@ -0,0 +1,33 @@
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("AppDiagnostic")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AppDiagnostic")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[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("fa9abad1-7184-4295-ade8-d44f2e3de6b2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+73
View File
@@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AppDiagnostic.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppDiagnostic.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon TBF_icon {
get {
object obj = ResourceManager.GetObject("TBF_icon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
}
}
+124
View File
@@ -0,0 +1,124 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="TBF_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TBF_icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
+30
View File
@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AppDiagnostic.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.0.3" targetFramework="net472" />
</packages>
+13 -4
View File
@@ -17,7 +17,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -30,12 +30,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -64,6 +69,7 @@
<DependentUpon>ModelessForm.cs</DependentUpon>
</Compile>
<Compile Include="Formulas.cs" />
<Compile Include="CurrentUser.cs" />
<Compile Include="GlobalData.cs" />
<Compile Include="IMeasurementCorrection.cs" />
<Compile Include="IOrderInfo.cs" />
@@ -76,6 +82,7 @@
</Compile>
<Compile Include="QuitAppException.cs" />
<Compile Include="SerializableDictionary.cs" />
<Compile Include="StatisticalMetrics.cs" />
<Compile Include="Telegram.cs" />
<Compile Include="UIControls\CoolButtonCtrl.cs">
<SubType>UserControl</SubType>
@@ -88,7 +95,9 @@
<Compile Include="Utils.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\ListViewEx.resx">
<DependentUpon>ListViewEx.cs</DependentUpon>
+132
View File
@@ -0,0 +1,132 @@
///
/// Copyright (c) 2021-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Common
{
class UserAndForm
{
public readonly IUser User;
public readonly Form Form;
public UserAndForm(IUser user, Form form)
{
User = user;
Form = form;
}
}
public static class CurrentUser
{
public const string AdminUsername = "admin";
public const string AdminPassword = "staratura";
public static int MinPasswdLength = 0;
public static int PasswdExpirationPeriodDays = 0;
public static DBSettings RemoteUsersDB = null;
public static DBSettings LocalUsersDB = null;
static readonly Stack<UserAndForm> userStack = new Stack<UserAndForm>();
public static Common.AuthorizedAs AuthorizedAs;
public static DateTime LastAuthorization = DateTime.Now;
/// <summary>
/// Push a new user into the stack of users and form references.
/// Prevent double user stack entry for the same Windows form.
/// </summary>
/// <param name="newUser">New user</param>
/// <param name="currentForm">Reference to the current form</param>
public static void Change(IUser newUser, Form currentForm)
{
if (userStack.Count > 0 && userStack.Peek().Form == currentForm)
{
userStack.Pop();
}
userStack.Push(new UserAndForm(newUser, currentForm));
}
/// <summary>
/// Restore an original user from the stack of users - remove user at the top of the stack.
/// Prevent restoring when there is no entry for the form currently being closed.
/// </summary>
/// <param name="formBeingClosed">Reference to the form currently being closed</param>
/// <returns>true = current user was restored, false = no current user change</returns>
public static bool Restore(Form formBeingClosed)
{
if (userStack.Count > 0 && userStack.Peek().Form == formBeingClosed)
{
userStack.Pop();
return true;
}
return false;
}
/// <summary>
/// Return the user currenty at the top of the stack of users.
/// </summary>
public static IUser User()
{
return (userStack.Count > 0) ? userStack.Peek().User : null; /// TODO: Return default user when stack is empty
}
public static IUser User2;
public static IUser User3;
/// <summary>
/// Return the current user name or an empty string
/// </summary>
public static string UserName()
{
if (User() == null || User().UserName == null)
return string.Empty;
else if (User2 == null || User2.UserName == null)
return User().UserName;
else if (User3 == null || User3.UserName == null)
return string.Format("{0},{1}", User().UserName, User2.UserName);
else
return string.Format("{0},{1},{2}", User().UserName, User2.UserName, User3.UserName);
}
public static string GetEncodedString(string legalizator)
{
if (User() == null || User().UserName == null) return string.Empty;
return string.Format("{0}~{1}~{2}",
User().UserName,
User().FullName == null ? string.Empty : User().FullName,
legalizator == null ? string.Empty : legalizator);
}
/// <summary>
/// Return the current user number or 0
/// </summary>
public static int Number()
{
return (User() != null) ? User().Number : 0;
}
public static bool IsPowerUser()
{
return (User() != null) ? User().IsPowerUser() : false;
}
public static bool IsMemberOf(GID groupId)
{
return (User() != null) ? User().IsMemberOf(groupId) : false;
}
public static bool IsMemberOf(GID[] groupIds)
{
return (User() != null) ? User().IsMemberOf(groupIds) : (groupIds == null);
}
}
}
+2 -2
View File
@@ -10,14 +10,14 @@ namespace Common
/// </summary>
public class DBSettings : ICloneable
{
public Common.DBType DbType;
public DBType DbType;
public string ConnectionString;
public DBSettings()
{
}
public DBSettings(Common.DBType dbType, string connectionString)
public DBSettings(DBType dbType, string connectionString)
{
this.DbType = dbType;
this.ConnectionString = connectionString;
+94 -8
View File
@@ -1,9 +1,10 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
namespace Common
{
@@ -185,16 +186,70 @@ namespace Common
Count,
}
public enum FlowNames
{
QnQtQmin = 0,
Q3Q2Q1 = 1,
QpQi = 2,
Count,
}
public enum ProfileType
{
Q3R,
QnClassColdWater,
QnClassHotWater,
QpQi,
CompoundQ3RQ3R,
CompoundQnClassQnClass,
CompoundQ3RQnClass,
CompoundQnClassQ3R,
CompoundQpQiQpQi,
Manual,
Count,
}
public enum FlowId
{
Any,
Q4,
Q3,
Q2,
Q1,
Q4Main,
Q3Main,
Q2Main,
Q1Main,
Q4Aux,
Q3Aux,
Q2Aux,
Q1Aux,
Qmax,
Qn,
Qt,
Qmin,
QmaxMain,
QnMain,
QtMain,
QminMain,
QmaxAux,
QnAux,
QtAux,
QminAux,
Qp,
Qp10,
Qi,
QpMain,
Qp10Main,
QiMain,
QpAux,
Qp10Aux,
QiAux,
Qdetected,
Qfall,
Qrise,
}
public enum ErrorLimitType
{
Manual,
@@ -235,11 +290,20 @@ namespace Common
CompoundAux,
Compound,
HeatMeterVolume,
HeatMeterEnergy,
HeatMeterMass,//...MF
HeatMeterEnergy,
SingleOrCompound, /// Only used when querying results
}
public enum Medium
public enum PulsesTypeByQuantity : short
{
[Description("dm3")] Volume_dm3,
[Description("kg")] Mass_kg,
Count
}
public enum Medium
{
[Description("")] NotSpecified,
#if LANG_PL
@@ -266,11 +330,13 @@ namespace Common
[Description("V")] V, /// vertical
[Description("STR")] S, /// standrohre
[Description("F")] F, /// fall
[Description("H/V")] HV, /// horizontal / vertical
#else
[Description("H")] H, /// horizontal
[Description("V")] V, /// vertical
[Description("S")] S, /// steig
[Description("F")] F, /// fall
[Description("H")] H, /// horizontal
[Description("V")] V, /// vertical
[Description("S")] S, /// steig
[Description("F")] F, /// fall
[Description("H/V")] HV, /// horizontal / vertical
#endif
Count
}
@@ -464,8 +530,10 @@ namespace Common
public enum TestProfile
{
UserDefined,
UserDefinedCompound,
UserDefinedHeatMeter,
Protected, /// The first protected one
ProtectedCompound,
ProtectedHeatMeter,
}
@@ -640,7 +708,16 @@ namespace Common
Count,
}
public enum ImageRotation
public enum DivResolution : int
{
[Description("1 ms (0.25 s)")] _1ms = 0,
[Description("2 ms (0.5 s)")] _2ms = 1,
[Description("4 ms (1 s)")] _4ms = 2,
[Description("8 ms (2 s)")] _8ms = 3,
Count,
}
public enum ImageRotation
{
[Description("0 deg")] None,
[Description("90 deg")] Deg90,
@@ -762,6 +839,15 @@ namespace Common
E63 = (1L << 62),
}
//...MF
public enum FlowType : int
{
none,
volume,
mass,
Count,
}
#region iPERL enums
public enum Side
+3
View File
@@ -61,6 +61,9 @@ namespace Common.Forms
private const int HDN_ITEMCHANGINGW = (HDN_FIRST-20);
#endregion
public MySortOrder SortOrder = MySortOrder.None;
public int SortColumn = -1;
/// <summary>
/// Required designer variable.
/// </summary>
+4 -1
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
///
using System;
namespace Common.Forms
{
+7 -4
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
///
using System;
using System.Drawing;
using System.Windows.Forms;
@@ -53,20 +56,20 @@ namespace Common.Forms
public event EventHandler<MessageEventArgs> UpdateMessageHandler;
void OnUpdateMessage(object sender, MessageEventArgs args)
{
if (args.Message != null) label1.Text = args.Message;
if (args != null && args.Message != null) label1.Text = args.Message;
}
/// <summary>
/// Called from the state machine when an operation forces a modeless dialog close.
/// </summary>
public static void CloseForm()
public void CloseForm()
{
if (CloseFormHandler == null) return;
try { CloseFormHandler(null, null); }
catch (Exception) { }
}
static public event EventHandler<EventArgs> CloseFormHandler;
public event EventHandler<EventArgs> CloseFormHandler;
void OnCloseForm(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
+2 -2
View File
@@ -213,9 +213,9 @@ namespace Common
/// </summary>
public static double ErrorFromVolumes(double measuredVolume, double trueVolume)
{
if (trueVolume <= float.Epsilon)
if (Math.Abs(trueVolume) <= float.Epsilon)
{
if (measuredVolume <= float.Epsilon)
if (Math.Abs(measuredVolume) <= float.Epsilon)
{
log.WarnFormat("ErrorFromVolumes({0},{1}) returns {2}", measuredVolume, trueVolume, -100.0);
return -100.0;
+1 -29
View File
@@ -5,38 +5,10 @@ using System;
namespace Common
{
public class GlobalData
public static class GlobalData
{
public static double SampleDensity = 0; /// sample water density measured in an accredited labo [kg/m3]
public static double SampleTemp = 0; /// sample temperature when density measured in an accredited labo [°C]
public static double Buoyancy = 0;
public const string AdminUsername = "admin";
public const string AdminPassword = "staratura";
public static DBSettings RemoteUsersDB = null;
public static DBSettings LocalUsersDB = null;
public static IUser CurrentUser;
public static IUser CurrentUser2;
public static IUser CurrentUser3;
public static Common.AuthorizedAs AuthorizedAs;
public static DateTime LastAuthorization = DateTime.Now;
public static int MinPasswdLength = 0;
public static int PasswdExpirationPeriodDays = 0;
public static string GetCurrentUserName()
{
if (CurrentUser == null || CurrentUser.UserName == null)
return string.Empty;
else if (CurrentUser2 == null || CurrentUser2.UserName == null)
return CurrentUser.UserName;
else if (CurrentUser3 == null || CurrentUser3.UserName == null)
return string.Format("{0},{1}", CurrentUser.UserName, CurrentUser2.UserName);
else
return string.Format("{0},{1},{2}", CurrentUser.UserName, CurrentUser2.UserName, CurrentUser3.UserName);
}
}
}
+2 -2
View File
@@ -5,7 +5,7 @@ namespace Common
public interface IMeasurementCorrection
{
int RangeIx { get; set; }
float Measurement { get; set; }
float Correction { get; set; }
double Measurement { get; set; }
double Correction { get; set; }
}
}
+1
View File
@@ -10,6 +10,7 @@ namespace Common
int Number { get; }
/// Access rights
bool IsPowerUser();
bool IsMemberOf(GID group);
bool IsMemberOf(GID[] groups);
bool IsCorrectPassword(string password);
+8 -6
View File
@@ -35,7 +35,7 @@ namespace Common.Iperl
public float RefFlow; /// [m3/h]
public int Counter;
public UInt32 EmfRaw; /// From iPerl opto data
public Int32 EmfRaw; /// Signed EMF from iPerl opto data
public Int16 MagneticFieldRaw;
public Int16 FlowRaw;
public UInt32 VolumeRaw;
@@ -50,14 +50,13 @@ namespace Common.Iperl
///
public double EMF()
{
Int32 signedEmf = (EmfRaw > 0x7FFFFF) ? ((int)EmfRaw - 0x1000000) : (int)EmfRaw;
return 0.000000333 * (double)signedEmf;
return 0.000000333 * (double)EmfRaw;
}
public double MagneticField() { return (double)MagneticFieldRaw; }
public double Flow(double scalingFactor) { return 0.225 * scalingFactor * (double)FlowRaw; }
public double Volume(double scalingFactor) { return 0.0000625 * scalingFactor * (double)VolumeRawExt; }
public Int32 FlipTime() { return Impedance; }
public decimal TimestampDec() { return (decimal)TimestampExt / (decimal)8192; }
public decimal TimestampDec() { return (decimal)TimestampExt; }
public double VolumeDelta(double scalingFactor, OptoTelegramRaw previous) { return (previous == null) ? 0 : Volume(scalingFactor) - previous.Volume(scalingFactor); }
public decimal TimeDelta() { return TimestampDec() - TestStartTimestampDec; }
public string Label()
@@ -120,7 +119,10 @@ namespace Common.Iperl
return false;
}
bool f1 = UInt32.TryParse(telegram.Substring(0, 6), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out EmfRaw);
UInt32 uEmfRaw;
bool f1 = UInt32.TryParse(telegram.Substring(0, 6), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out uEmfRaw);
EmfRaw = (uEmfRaw > 0x7FFFFF) ? ((int)uEmfRaw - 0x1000000) : (int)uEmfRaw;
bool f2 = Int16.TryParse(telegram.Substring(7, 4), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out MagneticFieldRaw);
bool f3 = Int16.TryParse(telegram.Substring(12, 4), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out FlowRaw);
bool f4 = UInt32.TryParse(telegram.Substring(17, 6), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out VolumeRaw);
@@ -243,7 +245,7 @@ namespace Common.Iperl
DateTime.Second.ToString("D2"),
DateTime.Millisecond.ToString("D4"),
Counter,
EmfRaw.ToString("X6"),
(EmfRaw & 0x00FFFFFF).ToString("X6"),
MagneticFieldRaw.ToString("X4"),
FlowRaw.ToString("X4"),
VolumeRaw.ToString("X6"),
+338
View File
@@ -0,0 +1,338 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Iperl;
namespace Common
{
public static class Extensions
{
public static float[] SubArray(this float[] array, int offset, int length)
{
float[] result = new float[length];
Array.Copy(array, offset, result, 0, length);
return result;
}
}
public class StatisticalMetrics
{
const int VectorSize = 7;
const int MinLength = 100;
const float AdcBit = (float)57e-9;
const int NeighbourhoodSize = 30; /// To determine extended outliers
/// <summary>
/// Calculates a 7-dimensional vector with these components:
/// x[0] = X1 = Number of outliers
/// x[1] = X2 = Relative cal-factor shift due to outliers
/// x[2] = X3 = Standard deviation of high-pass filteres ++++ demodulation of EMF (cut-off at Nyquist frequency)
/// x[3] = X4 = Robust standard deviation of high-pass filtered ++++ demodulation
/// x[4] = X5 = Peak-to-peak of low-pass filtered ++++ demodulation of EMF (cut-off TBD)
/// x[5] = X6 = Peak-to-peak of reference flow rate
/// x[6] = X7 = Mean impedance (++-- demodulation)
/// </summary>
/// <param name="optoData"></param>
/// <param name="optoDataCount"></param>
/// <param name="startIx"></param>
/// <param name="endIx"></param>
/// <returns></returns>
public static float[] Calculate(OptoTelegramRaw[] optoData, int optoDataCount, int startIx, int endIx, bool downsample,
out float[] offsetV, out float[] kOhmsR, out float[] kOhmsC, out float[] dutFlow,
out float[] refFlow, out float[] flowRatio, out float[] magField, out float[] emfV,
out PointF[] outliers, out PointF[] extendedOutliers)
{
offsetV = kOhmsR = kOhmsC = dutFlow = refFlow = flowRatio = magField = emfV = null;
outliers = extendedOutliers = null;
if (optoData == null || optoData.Length < optoDataCount ||
startIx < 0 || endIx >= optoDataCount || endIx <= startIx + MinLength + 3) return null;
float[] modulatedData = GetModulatedEmf(optoData, optoDataCount, AdcBit);
FindShiftAndDemodulate(modulatedData, downsample,
new float[] { +1, +1, +1, +1 }, out offsetV,
new float[] { +1, +1, -1, -1 }, out kOhmsR,
new float[] { +1, -1, -1, +1 }, out kOhmsC,
new float[] { +1, -1, +1, -1 }, out dutFlow);
//offsetV = FirFilter(modulatedData, new float[] { 1, 3, 4, 4, 3, 1}, 0.0625F);
magField = GetMagField(optoData, optoDataCount, downsample, new float[] { 1, 1, 1, 1 });
refFlow = GetRefFlow(optoData, optoDataCount, downsample, new float[] { 1, 1, 1, 1 });
flowRatio = new float[Math.Min(dutFlow.Length, refFlow.Length)];
for (int i = 0; i < flowRatio.Length; i++)
{
flowRatio[i] = (refFlow[i] != 0) ? dutFlow[i] / refFlow[i] : 1;
}
float[] x = new float[VectorSize];
/// X1 = Number of outliers
int outliersCount = GetOutliers(flowRatio, out outliers, out extendedOutliers);
/// X2 = Relative cal-factor shift due to outliers
/// X3 = Standard deviation of high-pass filteres ++++ demodulation of EMF (cut-off at Nyquist frequency)
/// X4 = Robust standard deviation of high-pass filtered ++++ demodulation
/// X5 = Peak-to-peak of low-pass filtered ++++ demodulation of EMF (cut-off TBD)
/// X6 = Peak-to-peak of reference flow rate
/// X7 = Mean impedance (++-- demodulation)
double sum = 0;
foreach (var z in kOhmsR) sum += z;
x[6] = Convert.ToSingle(sum / kOhmsR.Length);
return x;
}
static float[] GetModulatedEmf(OptoTelegramRaw[] optoData, int optoDataCount, float factor)
{
if (optoData == null || optoDataCount < 0) return null;
float[] result = new float[optoDataCount];
for (int i = 0; i < optoDataCount; i++)
{
result[i] = optoData[i].EmfRaw * factor;
}
return result;
}
static float[] GetMagField(OptoTelegramRaw[] optoData, int optoDataCount, bool downsample, float[] kernel)
{
if (optoData == null || optoDataCount < 0 || (downsample && (kernel == null || kernel.Length < 4))) return null;
int resultLen = downsample ? (optoDataCount / 4) : optoDataCount;
float[] result = new float[resultLen];
if (downsample)
{
float ksum = 0;
for (int j = 0; j < kernel.Length; j++) ksum += kernel[j];
for (int j = 0; j < kernel.Length; j++) kernel[j] /= ksum;
for (int i = 0; (4 * i) + kernel.Length - 1 < optoDataCount; i++)
{
float sum = 0;
for (int j = 0; j < kernel.Length; j++) sum += Convert.ToSingle(optoData[4 * i + j].MagneticFieldRaw) * kernel[j];
result[i] = sum;
}
}
else
{
for (int i = 0; i < optoDataCount; i++) result[i] = optoData[i].MagneticFieldRaw;
}
return result;
}
static float[] GetRefFlow(OptoTelegramRaw[] optoData, int optoDataCount, bool downsample, float[] kernel)
{
if (optoData == null || optoDataCount < 0 || (downsample && (kernel == null || kernel.Length < 4))) return null;
int resultLen = downsample ? (optoDataCount / 4) : optoDataCount;
float[] result = new float[resultLen];
if (downsample)
{
float ksum = 0;
for (int j = 0; j < kernel.Length; j++) ksum += kernel[j];
for (int j = 0; j < kernel.Length; j++) kernel[j] /= ksum;
for (int i = 0; (4 * i) + kernel.Length - 1 < optoDataCount; i++)
{
float sum = 0;
for (int j = 0; j < kernel.Length; j++) sum += Convert.ToSingle(optoData[4 * i + j].RefFlow) * kernel[j];
result[i] = sum;
}
}
else
{
for (int i = 0; i < optoDataCount; i++) result[i] = optoData[i].RefFlow;
}
return result;
}
public static void FindShiftAndDemodulate(float[] modulatedData, bool downsample,
float[] kernel1, out float[] data1,
float[] kernel2, out float[] data2,
float[] kernel3, out float[] data3,
float[] kernel4, out float[] data4)
{
int shift = GetShift(modulatedData.SubArray(0, MinLength));
data1 = (kernel1 != null) ? Demodulate(modulatedData, kernel1, shift, downsample) : null;
data2 = (kernel2 != null) ? Demodulate(modulatedData, kernel2, shift, downsample) : null;
data3 = (kernel3 != null) ? Demodulate(modulatedData, kernel3, shift, downsample) : null;
data4 = (kernel4 != null) ? Demodulate(modulatedData, kernel4, shift, downsample) : null;
}
/// <summary>
/// Unlike FIR filtering, demodulation shifts the kernel in 4 phases
/// </summary>
/// <param name="data">Input data</param>
/// <param name="kernel">Demodulation kernel</param>
/// <param name="shift">shift 0..3</param>
/// <returns>Output data</returns>
static float[] Demodulate(float[] data, float[] kernel, int shift, bool downsample)
{
if (data == null || data.Length < MinLength || kernel == null || kernel.Length != 4)
{
return null;
}
float ksum = 0;
for (int i = 0; i < 4; i++) ksum += Math.Abs(kernel[i]);
for (int i = 0; i < 4; i++) kernel[i] /= ksum;
int rsltLen = downsample ? (data.Length - 3) / 4 : data.Length - 3;
float[] result = new float[rsltLen];
if (downsample)
{
for (int i = shift; i < 4 * rsltLen; i += 4)
{
float sum = 0;
for (int j = 0; j < 4; j++) sum += data[i + j] * kernel[(i + j + 4 - shift) % 4];
result[i / 4] = sum;
}
}
else
{
for (int i = 0; i < rsltLen; i++)
{
float sum = 0;
for (int j = 0; j < 4; j++) sum += data[i + j] * kernel[(i + j + 4 - shift) % 4];
result[i] = sum;
}
}
return result;
}
/// <summary>
/// Determine modulation phase by maximizing ++-- demodulation result.
/// </summary>
/// <param name="modulatedEmf">Input data</param>
/// <returns>0..3 = modulation phase or, -1 = error</returns>
static int GetShift(float[] modulatedData)
{
float[] kernel = new float[4] { 1, 1, -1, -1 };
int maximizingShift = -1;
float maximum = float.MinValue;
for (int shift = 0; shift <= 3; shift++)
{
var demodulatedCandidate = Demodulate(modulatedData, kernel, shift, false);
float sum = 0;
foreach (var d in demodulatedCandidate) sum += d;
if (sum > maximum)
{
maximum = sum;
maximizingShift = shift;
}
}
return maximizingShift;
}
/// <summary>
/// FIR filtering = convolution with a kernel
/// </summary>
/// <param name="data">Input data</param>
/// <param name="kernel">Convolution kernel</param>
/// <returns>Output data</returns>
static float[] FirFilter(float[] data, float[] kernel, float factor)
{
if (data == null || kernel == null) return null;
int kernelLen = kernel.Length;
int rsltLen = data.Length - kernelLen + 1;
if (rsltLen < 0) return null;
float[] result = new float[rsltLen];
for (int i = 0; i < rsltLen; i++)
{
float sum = 0;
for (int j = 0; j < kernelLen; j++) sum += data[i + j] * kernel[j];
result[i] = sum * factor;
}
return result;
}
static int GetOutliers(float[] flowRatio, out PointF[] outliers, out PointF[] extendedOutliers)
{
float mean = Enumerable.Average(flowRatio);
var fr = new float[flowRatio.Length];
for (int i = 0; i < fr.Length; i++) fr[i] = flowRatio[i] - mean;
Array.Sort(fr);
float qLo = fr[fr.Length / 4];
float qHi = fr[3 * fr.Length / 4];
int N = fr.Length / 2;
float sumY = 0;
float sumYY = 0;
for (int i = fr.Length / 4; i < 3 * fr.Length / 4; i++)
{
sumY += fr[i];
sumYY += fr[i] * fr[i];
}
float std = (float)Math.Sqrt(sumYY / N - (sumY / N) * (sumY / N));
float robustStd = std * 5.1812824F;
float threshold = 7 * robustStd;
/// Restore fr as it was before sorting
for (int i = 0; i < fr.Length; i++) fr[i] = flowRatio[i] - mean;
IList<PointF> listOfOutliers = new List<PointF>();
bool[] boolExtendedOutliers = new bool[fr.Length];
int outliersCount = 0;
for (int i = 0; i < fr.Length; i++)
{
if (fr[i] < -threshold || fr[i] > threshold)
{
/// This is an outlier
listOfOutliers.Add(new PointF(Convert.ToSingle(i), fr[i] + mean));
outliersCount++;
for (int j = Math.Max(0, i - NeighbourhoodSize); j <= Math.Min(i + NeighbourhoodSize, fr.Length - 1); j++)
{
boolExtendedOutliers[j] = true;
}
}
}
IList<PointF> listOfExtendedOutliers = new List<PointF>();
for (int i = 0; i < fr.Length; i++)
{
if (boolExtendedOutliers[i])
{
listOfExtendedOutliers.Add(new PointF(Convert.ToSingle(i), fr[i] + mean));
}
}
outliers = listOfOutliers.ToArray<PointF>();
extendedOutliers = listOfExtendedOutliers.ToArray<PointF>();
return outliersCount;
}
}
}
+145 -38
View File
@@ -2,7 +2,7 @@
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
///
using System;
using System.Reflection;
using System.Linq;
namespace Common
{
@@ -34,6 +34,20 @@ namespace Common
[Description("m3/m")] m3pm, /// 1 m3/m = 60 m3/h
[Description("cf/s")] cfs, /// 1 cubic foot per second = 101.9406477312 m3/h
[Description("g/s")] gps, /// 1 g/s = 0.0036 t/h
[Description("g/min")] gpm, /// 1 g/min = 0.00006 t/h
[Description("g/h")] gph, /// 1 g/h = 0.000001 t/h
[Description("kg/s")] kgps, /// 1 kg/s = 3.6 t/h
[Description("kg/min")] kgpm, /// 1 kg/min = 0.06 t/h
[Description("kg/h")] kgph, /// 1 kg/h = 0.001 t/h
[Description("t/s")] tps, /// 1 t/s = 3600 t/h
[Description("t/min")] tpm, /// 1 t/min = 60 t/h
[Description("t/h")] tph, /// 1 t/h = 1 t/h
[Description("lb/s")] lbps, /// 1 lb/s ≈ 1.633 t/h
[Description("lb/min")] lbpm, /// 1 lb/min ≈ 0.027216 t/h
[Description("lb/h")] lbph, /// 1 lb/h ≈ 0.0004536 t/h
[Description("g")] g, /// 0.001 kg
[Description("oz")] oz, /// 0.0283495231 kg
[Description("lb")] lb, /// 0.45359237 kg
@@ -106,6 +120,14 @@ namespace Common
///
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
[Description("kWh/pulse")] kWhpp, /// 1 kWh/pulse
///
[Description("A")] A, /// *1 A
[Description("mA")] mA, /// 1 mA = 0.001 A
///
[Description("V")] V, /// *1 V
[Description("mV")] mV, /// 1 mV = 0.001 V
Count
}
@@ -136,6 +158,8 @@ namespace Common
[Description("Boolean")] Boolean,
[Description("Datum und Uhrzeit")] DateTime,
[Description("Aufgezählt")] Enumerated,
[Description("Strom")] Current,
[Description("Spannung")] Voltage,
#elif LANG_PL
[Description("Objętość")] Volume,
[Description("Przepływ")] Flow,
@@ -159,6 +183,8 @@ namespace Common
[Description("Boolean")] Boolean,
[Description("Data i czas")] DateTime,
[Description("Wyliczone")] Enumerated,
[Description("Prąd")] Current,
[Description("Napięcie")] Voltage,
#elif LANG_CS
[Description("Objem")] Volume,
[Description("Průtok")] Flow,
@@ -182,6 +208,8 @@ namespace Common
[Description("Boolean")] Boolean,
[Description("Datum a čas")] DateTime,
[Description("Vyjmenované")] Enumerated,
[Description("Proud")] Current,
[Description("Napětí")] Voltage,
#elif LANG_IT
[Description("Volume")] Volume,
[Description("Flusso")] Flow,
@@ -205,10 +233,16 @@ namespace Common
[Description("Boolean")] Boolean,
[Description("Data e ora")] DateTime,
[Description("Enumerato")] Enumerated,
[Description("Corrente")] Current,
[Description("Voltaggio")] Voltage,
#else
[Description("RegisterReader")] RegisterReader,
[Description("MultiFunctionalVariables")] MultiFunctionalVariables,
[Description("VolumeFlow")] VolumeFlow,
[Description("Volume")] Volume,
[Description("Flow")] Flow,
[Description("Mass")] Mass,
[Description("MassFlow")] MassFlow,
[Description("Mass")] Mass,
[Description("Time")] Time,
[Description("Temperature")] Temperature,
[Description("Pressure")] Pressure,
@@ -219,6 +253,8 @@ namespace Common
[Description("Energy")] Energy,
[Description("Pulses")] Pulses,
[Description("Pulses/liter")] PulsePerLtr,
[Description("Pulses/kg")] PulsePerKilogram, //...MF
[Description("Pulses/Unit")] PulsePerUnit,//...MF
[Description("Pulses/kWh")] PulsePerKWh,
[Description("Conductivity")] Conductivity,
@@ -228,6 +264,8 @@ namespace Common
[Description("Boolean")] Boolean,
[Description("Date and time")] DateTime,
[Description("Enumerated")] Enumerated,
[Description("Current")] Current,
[Description("Voltage")] Voltage,
#endif
Count,
}
@@ -243,59 +281,103 @@ namespace Common
{
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.A ||
unit == Unit.V;
}
public static bool IsQuantity(Unit unit, Quantity quantity)
{
return (quantity == GetQuantity(unit));
return GetQuantity(unit).Contains(quantity);
}
public static Quantity GetQuantity(Unit unit)
public static Quantity[] GetQuantity(Unit unit)
{
switch (unit)
{
case Unit.pulse:
case Unit.degree:
return Quantity.Pulses;
return new[] { Quantity.Pulses };
case Unit.ml:
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.l:
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.dm3:
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.USgal:
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.UKgal:
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.cf:
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.m3:
return Quantity.Volume;
return new[] { Quantity.Volume, Quantity.MultiFunctionalVariables };
case Unit.lph:
return new[] { Quantity.Flow };
case Unit.cfph:
return new[] { Quantity.Flow };
case Unit.lpm:
return new[] { Quantity.Flow };
case Unit.USgalpm:
return new[] { Quantity.Flow };
case Unit.m3ph:
return new[] { Quantity.Flow };
case Unit.lps:
return new[] { Quantity.Flow };
case Unit.USgalps:
return new[] { Quantity.Flow };
case Unit.m3pm:
return new[] { Quantity.Flow };
case Unit.cfs:
return Quantity.Flow;
return new[] { Quantity.Flow };
case Unit.gps:
return new[] { Quantity.MassFlow};
case Unit.gpm:
return new[] { Quantity.MassFlow};
case Unit.gph:
return new[] { Quantity.MassFlow};
case Unit.kgps:
return new[] { Quantity.MassFlow};
case Unit.kgpm:
return new[] { Quantity.MassFlow};
case Unit.kgph:
return new[] { Quantity.MassFlow};
case Unit.tps:
return new[] { Quantity.MassFlow};
case Unit.tpm:
return new[] { Quantity.MassFlow};
case Unit.tph:
return new[] { Quantity.MassFlow};
case Unit.lbps:
return new[] { Quantity.MassFlow};
case Unit.lbpm:
return new[] { Quantity.MassFlow};
case Unit.lbph:
return new[] { Quantity.MassFlow};
case Unit.g:
return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables };
case Unit.oz:
return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables };
case Unit.lb:
return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables };
case Unit.kg:
return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables };
case Unit.t:
return Quantity.Mass;
return new[] { Quantity.Mass, Quantity.MultiFunctionalVariables };
case Unit.ms:
case Unit.s:
case Unit.min:
case Unit.hour:
return Quantity.Time;
return new[] { Quantity.Time };
case Unit.C:
case Unit.F:
case Unit.K:
return Quantity.Temperature;
return new[] { Quantity.Temperature };
case Unit.Pa:
case Unit.hPa:
@@ -305,14 +387,14 @@ namespace Common
case Unit.psi:
case Unit.bar:
case Unit.MPa:
return Quantity.Pressure;
return new[] { Quantity.Pressure };
case Unit.RPct:
return Quantity.Humidity;
return new[] { Quantity.Humidity };
case Unit.Promile:
case Unit.Pct:
return Quantity.Error;
return new[] { Quantity.Error };
case Unit.mm:
case Unit.cm:
@@ -321,23 +403,23 @@ namespace Common
case Unit.foot:
case Unit.yard:
case Unit.m:
return Quantity.Length;
return new[] { Quantity.Length };
case Unit.kgpm3:
case Unit.kgpm3:
case Unit.kgpl:
return Quantity.Density;
return new[] { Quantity.Density };
case Unit.J:
case Unit.J:
case Unit.kJ:
case Unit.MJ:
case Unit.Wh:
case Unit.kWh:
case Unit.MWh:
return Quantity.Energy;
return new[] { Quantity.Energy };
case Unit.uSpcm:
case Unit.mSpm:
return Quantity.Conductivity;
return new[] { Quantity.Conductivity };
case Unit.ppl:
case Unit.ppdm3:
@@ -347,32 +429,44 @@ namespace Common
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg:
return Quantity.PulsePerLtr;
return new[] { Quantity.PulsePerLtr };
case Unit.ppkWh:
case Unit.kWhpp:
return Quantity.PulsePerKWh;
return new[] { Quantity.PulsePerKWh };
case Unit.A:
case Unit.mA:
return new[] { Quantity.Current };
case Unit.V:
case Unit.mV:
return new[] { Quantity.Voltage };
default:
return Quantity.Number;
return new[] { Quantity.Number };
}
}
public static bool IsVolume(Unit units) { return IsQuantity(units, Quantity.Volume); }
public static bool IsFlow(Unit units) { return IsQuantity(units, Quantity.Flow); }
public static bool IsMass(Unit units) { return IsQuantity(units, Quantity.Mass); }
public static bool IsTime(Unit units) { return IsQuantity(units, Quantity.Time); }
public static bool IsTemperature(Unit units) { return IsQuantity(units, Quantity.Temperature); }
public static bool IsPressure(Unit units) { return IsQuantity(units, Quantity.Pressure); }
public static bool IsHumidity(Unit units) { return IsQuantity(units, Quantity.Humidity); }
public static bool IsError(Unit units) { return IsQuantity(units, Quantity.Error); }
public static bool IsLength(Unit units) { return IsQuantity(units, Quantity.Length); }
public static bool IsDensity(Unit units) { return IsQuantity(units, Quantity.Density); }
public static bool IsEnergy(Unit units) { return IsQuantity(units, Quantity.Energy); }
public static bool IsPulses(Unit units) { return IsQuantity(units, Quantity.Pulses); }
public static bool IsPulsePerLtr(Unit units) { return IsQuantity(units, Quantity.PulsePerLtr); }
public static bool IsPulsePerKWh(Unit units) { return IsQuantity(units, Quantity.PulsePerKWh); }
public static bool IsConductivity(Unit units) { return IsQuantity(units, Quantity.Conductivity); }
public static bool IsVolumeFlow(Unit unit) { return IsQuantity(unit, Quantity.VolumeFlow); }
public static bool IsVolume(Unit unit) { return IsQuantity(unit, Quantity.Volume); }
public static bool IsFlow(Unit unit) { return IsQuantity(unit, Quantity.Flow); }
public static bool IsMassFlow(Unit unit) { return IsQuantity(unit, Quantity.MassFlow); }
public static bool IsMass(Unit unit) { return IsQuantity(unit, Quantity.Mass); }
public static bool IsTime(Unit unit) { return IsQuantity(unit, Quantity.Time); }
public static bool IsTemperature(Unit unit) { return IsQuantity(unit, Quantity.Temperature); }
public static bool IsPressure(Unit unit) { return IsQuantity(unit, Quantity.Pressure); }
public static bool IsHumidity(Unit unit) { return IsQuantity(unit, Quantity.Humidity); }
public static bool IsError(Unit unit) { return IsQuantity(unit, Quantity.Error); }
public static bool IsLength(Unit unit) { return IsQuantity(unit, Quantity.Length); }
public static bool IsDensity(Unit unit) { return IsQuantity(unit, Quantity.Density); }
public static bool IsEnergy(Unit unit) { return IsQuantity(unit, Quantity.Energy); }
public static bool IsPulses(Unit unit) { return IsQuantity(unit, Quantity.Pulses); }
public static bool IsPulsePerLtr(Unit unit) { return IsQuantity(unit, Quantity.PulsePerLtr); }
public static bool IsPulsePerKWh(Unit unit) { return IsQuantity(unit, Quantity.PulsePerKWh); }
public static bool IsConductivity(Unit unit) { return IsQuantity(unit, Quantity.Conductivity); }
public static bool IsCurrent(Unit unit) { return IsQuantity(unit, Quantity.Current); }
public static bool IsVoltage(Unit unit) { return IsQuantity(unit, Quantity.Voltage); }
@@ -456,6 +550,13 @@ namespace Common
case Unit.dm3pp:
case Unit.lpdeg:
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
/// Current: internal representation in A
case Unit.mA: return 1000 * v; /// 1000 mA = 1 A
/// Voltage: internal representation in V
case Unit.mV: return 1000 * v; /// 1000 mV = 1 V
default: return v; /// Do not convert
}
@@ -535,6 +636,12 @@ namespace Common
/// Electrical conductivity
case Unit.mSpm: return 10 * v;
/// Current: internal representation in A
case Unit.mA: return 0.001 * v; /// 1 mA = 0.001 A
/// Voltage: internal representation in V
case Unit.mV: return 0.001 * v; /// 1 mV = 0.001 V
/// Invert
case Unit.kWhpp:
+41 -7
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2021 Sensus Slovensko a.s.
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
///
using System;
@@ -14,6 +14,35 @@ namespace Common
return string.Format("{0} ({1}/{2})", name, repetitionNr, repeats);
}
public static string ToNiceString(double value, int sigDigits)
{
string format = SignificantDigitsToFmt(value, sigDigits);
return (format == "F0") ? value.ToString("F0") : value.ToString(format).TrimEnd(new char[] { '0' });
}
public static FlowNames ProfileType2FlowNames(ProfileType pt, bool isAux = false)
{
switch (pt)
{
case ProfileType.Q3R:
case ProfileType.CompoundQ3RQ3R:
return FlowNames.Q3Q2Q1;
case ProfileType.CompoundQ3RQnClass:
return isAux ? FlowNames.QnQtQmin : FlowNames.Q3Q2Q1;
case ProfileType.QnClassColdWater:
case ProfileType.QnClassHotWater:
case ProfileType.CompoundQnClassQnClass:
return FlowNames.QnQtQmin;
case ProfileType.CompoundQnClassQ3R:
return isAux ? FlowNames.Q3Q2Q1 : FlowNames.QnQtQmin;
case ProfileType.QpQi:
case ProfileType.CompoundQpQiQpQi:
return FlowNames.QpQi;
default:
return FlowNames.Q3Q2Q1;
}
}
public static string SignificantDigitsToFmt(double value, int sigDigits)
{
if (sigDigits == 6)
@@ -212,9 +241,9 @@ namespace Common
int length = string.IsNullOrEmpty(password) ? 0 : password.Length;
/// Password length must be at least 6
if (length < GlobalData.MinPasswdLength)
if (length < CurrentUser.MinPasswdLength)
{
explanation = string.Format("Password must have at least {0} characters", GlobalData.MinPasswdLength);
explanation = string.Format("Password must have at least {0} characters", CurrentUser.MinPasswdLength);
return false;
}
else
@@ -272,16 +301,21 @@ namespace Common
int number = (date.Year % 10) + 10 * (date.Month - 1) + 120 * date.Day;
string passwordOfDay = Convert.ToString(number, 8);
return (userName.Equals("milan") && password.Equals("kremik")) ||
return (userName.Equals("milan") && password.Equals("kraken")) ||
(userName.Equals("bumi") && password.Equals("70630")) ||
(userName.Equals("igor") && password.Equals("mojronko8")) ||
(userName.Equals("MARIAN") && password.Equals("NM-309BN")) ||
(userName.Equals("lubo1212") && password.Equals("Tatry52")) ||
(userName.Equals("Michal") && password.Equals("1236natahA8")) ||
(userName.Equals("Michal") && password.Equals("Plok789456123")) ||
(userName.Equals("martin") && password.Equals("vaclavek84")) ||
(userName.Equals("pakan") && password.Equals("kuriatko")) ||
(userName.Equals("augustin") && password.Equals("jaugust")) ||
(userName.Equals("jan") && password.Equals("jaugust")) ||
(userName.Equals("JCermak") && password.Equals("Zt6911")) ||
(userName.Equals("gilles") && password.Equals("alibaba")) ||
(userName.Equals("michal") && password.Equals("mojnelson8")) ||
(userName.Equals("marek") && password.Equals("mareciino")) ||
#if DEBUG
(userName.Equals("Sensus Developers") && password.Equals("5fbg12gf5hn8nhy1fr")) ||
#endif
(userName.Equals(passwordOfDay) && password.Equals(passwordOfDay));
}
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.15" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
</packages>
+9 -4
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW</DefineConstants>
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
@@ -43,7 +43,7 @@
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
@@ -68,6 +68,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="CalendarEvent\ICalendarEvent.cs" />
<Compile Include="Data.cs" />
<Compile Include="Entities\BenchPath.cs" />
<Compile Include="Entities\CustomEvent.cs" />
<Compile Include="Entities\Component.cs" />
@@ -95,6 +96,7 @@
<Compile Include="Entities\VirtualBenchStep.cs" />
<Compile Include="CalendarEvent\Utils.cs" />
<Compile Include="FluentCommon.cs" />
<Compile Include="Formulas.cs" />
<Compile Include="Mappings\BenchPathMap.cs" />
<Compile Include="Mappings\ComponentMap.cs" />
<Compile Include="Mappings\ComponentProcedureMap.cs" />
@@ -115,6 +117,7 @@
<Compile Include="Mappings\UncertaintyMap.cs" />
<Compile Include="Mappings\UserMap.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PurchaseResources.cs" />
<Compile Include="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -123,7 +126,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx" />
<EmbeddedResource Include="Resources\Strings.de.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.fr.resx" />
<EmbeddedResource Include="Resources\Strings.it.resx" />
<EmbeddedResource Include="Resources\Strings.pl.resx" />
+103
View File
@@ -0,0 +1,103 @@
using System;
//formulas.cs has been added cause iPerl from master-2 ...MF
namespace Config
{
public class Data
{
public const string AdminUsername = "admin";
public const string AdminPassword = "staratura";
public const string SQLiteDbFName = "SQLite.db";
#if 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 = 1;
#elif MUNICH
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif MALTA_WSD25
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif BADGER_MALA_TRAT || BERLIN || FUZHOU_150 || FUZHOU_300 || GELSENWASSER || GENESIS || IZRAEL_200 || PETERSBURG_200 || SENTEC || SLM_150 || TORINO_50
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 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 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_SPECIAL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif DEWA_300 || FUZHOU_100 || ROMA_200 || LUXEMBURG_40
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 SLM_END || WARSAW_END
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 4;
#elif SLM_50
public const int WMsCount = 12;
public const int LineSize = 12;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 6;
public const int MaxPartNr = WMsCount / LineSize;
#elif ALZIR_25 || BAHRAIN_50 || CEVAK_40 || FEWA_50 || FILIPINY_50 || FUZHOU_50 || HONGKONG_50 || IZRAEL_25 || JUZNA_AFRIKA_50 || KEMPNO_50 || KRAKOW_50 || MILWAUKEE || MURES_40 || PETERSBURG_50 || TORUN_50 || WARSAW_50 || ZAMBIA || ZODINO
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 || 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 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;
#endif
public static double RealDensity = 0; /// true water density [kg/m3]
public static double AtTemperature = 0; /// measured at temperature [°C]
public static double Buoyancy = 0;
}
}
+16 -4
View File
@@ -1,8 +1,9 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using Common;
namespace Config.Entities
{
@@ -12,27 +13,34 @@ namespace Config.Entities
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual double Qfrom { get; set; } /// Water flow in [m3/h]
public virtual double Qto { get; set; } /// Water flow in [m3/h]
public virtual Unit FlowUnit { get; set; } /// Not mapped to database, used in UI
public virtual string Selector { get; set; }
public virtual string TempMtrUp { get; set; }
public virtual string TempMtrDown { get; set; }
public virtual string PressMtrUp { get; set; }
public virtual string PressMtrDown { get; set; }
public virtual string PressMtrDelta { get; set; }
public virtual string ElectricMtrUp { get; set; }
public virtual string ElectricMtrDown { get; set; }
public virtual string ElectricMtrDelta { get; set; }
public virtual string StopBFValve { get; set; }
/// Valves
public virtual string ValvesOpen { get; set; }
public virtual string ValvesClose { get; set; }
public virtual bool QfromTextChngd { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual bool QtoTextChngd { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
/// ------------- Additional stuff not mapped into the database -------------
public BenchPath()
{
ValvesOpen = string.Empty;
ValvesClose = string.Empty;
}
}
public BenchPath(string name, int itemNr)
: this()
@@ -47,12 +55,16 @@ namespace Config.Entities
result.Qfrom = Qfrom;
result.Qto = Qto;
result.FlowUnit = FlowUnit;
result.Selector = Selector;
result.TempMtrUp = TempMtrUp;
result.TempMtrDown = TempMtrDown;
result.PressMtrUp = PressMtrUp;
result.PressMtrDown = PressMtrDown;
result.PressMtrDelta = PressMtrDelta;
result.ElectricMtrUp = ElectricMtrUp;
result.ElectricMtrDown = ElectricMtrDown;
result.ElectricMtrDelta = ElectricMtrDelta;
result.StopBFValve = StopBFValve;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
+12 -6
View File
@@ -1,27 +1,32 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using Common;
namespace Config.Entities
{
public class FeedingPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual double Qfrom { get; set; } /// Water flow in [m3/h]
public virtual double Qto { get; set; } /// Water flow in [m3/h]
public virtual Unit FlowUnit { get; set; } /// Not mapped to database, used in UI
public virtual string Selector { get; set; }
public virtual string Pump { get; set; }
public virtual string RegVPositions { get; set; } /// Positions of regulation valves in % separated by ';'
public virtual string RegVPositions { get; set; } /// Positions of regulation valves in Category.Feeding in % separated by ';'
/// Valves
public virtual string ValvesOpen { get; set; }
public virtual string ValvesClose { get; set; }
public virtual bool QfromTextChngd { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual bool QtoTextChngd { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
/// ------------- Additional stuff not mapped into the database -------------
public FeedingPath()
@@ -43,6 +48,7 @@ namespace Config.Entities
result.Qfrom = Qfrom;
result.Qto = Qto;
result.FlowUnit = FlowUnit;
result.Selector = Selector;
result.Pump = Pump;
result.RegVPositions = RegVPositions;
+17 -8
View File
@@ -1,17 +1,17 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
namespace Config.Entities
{
public class MeasurementCorrection : Common.IMeasurementCorrection
public class MeasurementCorrection : Common.IMeasurementCorrection, IComparable<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 virtual double Measurement { get; set; }
public virtual double Correction { get; set; }
public MeasurementCorrection()
{
@@ -23,6 +23,11 @@ namespace Config.Entities
RangeIx = rangeIx;
}
public virtual int CompareTo(MeasurementCorrection other)
{
return (Measurement > other.Measurement) ? 1 : ((Measurement == other.Measurement) ? 0 : -1);
}
/// <summary>
/// Calculates corrected value from a list of corrections by interpolation.
@@ -53,10 +58,9 @@ namespace Config.Entities
return corrections[0].Correction;
}
int count = corrections.Count;
for (int i = 1; i < count; i++)
for (int i = 1; i < corrections.Count; i++)
{
if (rawValue < corrections[0].Measurement)
if (rawValue < corrections[i].Measurement)
{
double d1 = rawValue - corrections[i - 1].Measurement;
double d2 = corrections[i].Measurement - rawValue;
@@ -75,7 +79,12 @@ namespace Config.Entities
}
/// rawValue is above the highest value in the correction table
return corrections[count - 1].Correction;
return corrections[corrections.Count - 1].Correction;
}
public override string ToString()
{
return string.Format("{0} {1} ({2})", Measurement, Correction, RangeIx);
}
}
}
+23 -10
View File
@@ -1,46 +1,56 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using Common;
namespace Config.Entities
{
public class OutputPath : IHasName, IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string OriName { get; set; } /// Not mapped to database
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual double Qfrom { get; set; } /// Water flow in [m3/h]
public virtual double Qto { get; set; } /// Water flow in [m3/h]
public virtual Unit FlowUnit { get; set; } /// Not mapped to database, used in UI
public virtual string Selector { get; set; }
public virtual string RegValve { get; set; }
public virtual string FlowMeter { get; set; }
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
public virtual int RegulMinStep { get; set; }
public virtual string FlowMeter { get; set; }
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
public virtual string StartValve { get; set; }
public virtual string Diverter { get; set; }
public virtual string TempMtrDiv { get; set; }
public virtual string Scale { get; set; }
public virtual string RegVPositions { get; set; } /// Positions of regulation valves in Category.Output in % separated by ';'
/// Valves
public virtual string ValvesOpen { get; set; }
public virtual string ValvesClose { get; set; }
public virtual bool QfromTextChngd { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual bool QtoTextChngd { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
/// ------------- Additional stuff not mapped into the database -------------
public OutputPath()
{
ValvesOpen = string.Empty;
ValvesClose = string.Empty;
}
RegulMinStep = 0;
}
public OutputPath(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
RegulMinStep = 0;
}
public virtual OutputPath Clone(string name, int itemNr)
{
@@ -49,14 +59,17 @@ namespace Config.Entities
result.Name = Name;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.FlowUnit = FlowUnit;
result.Selector = Selector;
result.RegValve = RegValve;
result.FlowMeter = FlowMeter;
result.RegulMinStep = RegulMinStep;
result.FlowMeter = FlowMeter;
result.PidCoef = PidCoef;
result.StartValve = StartValve;
result.Diverter = Diverter;
result.TempMtrDiv = TempMtrDiv;
result.Scale = Scale;
result.RegVPositions= RegVPositions;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
+33 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
using System;
using System.Globalization;
@@ -16,7 +16,9 @@ namespace Config.Entities
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 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 FlowId FlowId { get; set; }
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
@@ -27,6 +29,7 @@ namespace Config.Entities
public virtual double PressLimHi { get; set; } /// [bar] max. water pressure
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
public virtual string Method { get; set; } /// Test method (component name)
public virtual sbyte E1 { get; set; } ///
public virtual sbyte E2 { get; set; } ///
@@ -81,6 +84,7 @@ namespace Config.Entities
PressLimHi = 16.0; /// [bar]
Publish = (sbyte)Common.Publish.Always;
Evaluate = true;
Method = string.Empty;
E1 = (sbyte)ErrorFlagsMode.On;
E2 = (sbyte)ErrorFlagsMode.On;
@@ -140,6 +144,7 @@ namespace Config.Entities
result.PressLimHi = PressLimHi;
result.Publish = Publish;
result.Evaluate = Evaluate;
result.Method = Method;
result.E1 = E1;
result.E2 = E2;
@@ -183,6 +188,7 @@ namespace Config.Entities
output.WriteLine(Name);
output.WriteLine(Part);
output.WriteLine(((ushort)FlowId).ToString(ci));
output.WriteLine(CoefQfrom.ToString(ci));
output.WriteLine(CoefQto.ToString(ci));
output.WriteLine(ErrLimLo.ToString(ci));
@@ -193,6 +199,7 @@ namespace Config.Entities
output.WriteLine(PressLimHi.ToString(ci));
output.WriteLine(Publish.ToString());
output.WriteLine(Evaluate.ToString());
output.WriteLine(Method);
output.WriteLine(E1.ToString());
output.WriteLine(E2.ToString());
@@ -241,16 +248,36 @@ namespace Config.Entities
tst.Name = firstLine;
tst.Part = int.Parse(input.ReadLine());
tst.FlowId = (FlowId)ushort.Parse(input.ReadLine(), ci);
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);
tst.Publish = sbyte.Parse(input.ReadLine());
tst.PressLimLo = double.Parse(input.ReadLine(), ci);
tst.PressLimHi = double.Parse(input.ReadLine(), ci);
tst.Publish = sbyte.Parse(input.ReadLine(), ci);
tst.Evaluate = bool.Parse(input.ReadLine());
tst.Method = input.ReadLine();
/// TODO (E1 .. E21)
tst.E1 = sbyte.Parse(input.ReadLine(), ci);
tst.E2 = sbyte.Parse(input.ReadLine(), ci);
tst.E3 = sbyte.Parse(input.ReadLine(), ci);
tst.E4 = sbyte.Parse(input.ReadLine(), ci);
tst.E5 = sbyte.Parse(input.ReadLine(), ci);
tst.E6 = sbyte.Parse(input.ReadLine(), ci);
tst.E7 = sbyte.Parse(input.ReadLine(), ci);
tst.E8 = sbyte.Parse(input.ReadLine(), ci);
tst.E9 = sbyte.Parse(input.ReadLine(), ci);
tst.E10 = sbyte.Parse(input.ReadLine(), ci);
tst.E11 = sbyte.Parse(input.ReadLine(), ci);
tst.E12 = sbyte.Parse(input.ReadLine(), ci);
tst.E13 = sbyte.Parse(input.ReadLine(), ci);
tst.E14 = sbyte.Parse(input.ReadLine(), ci);
tst.E15 = sbyte.Parse(input.ReadLine(), ci);
tst.E16 = sbyte.Parse(input.ReadLine(), ci);
tst.E21 = sbyte.Parse(input.ReadLine(), ci);
tst.Delta_Q_pct = double.Parse(input.ReadLine(), ci);
tst.Delta_T = double.Parse(input.ReadLine(), ci);
@@ -283,6 +310,7 @@ namespace Config.Entities
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 != ((ushort)FlowId).ToString()){diff.AppendFormat(fmt, "FlowId", ((ushort)FlowId).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); };
@@ -293,6 +321,7 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != PressLimHi.ToString(ci)) { diff.AppendFormat(fmt, "Pressure_max", PressLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Publish.ToString()) { diff.AppendFormat(fmt, "Publish", Publish.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Evaluate.ToString()) { diff.AppendFormat(fmt, "Evaluate", Evaluate.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, 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); };
+3 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -47,7 +47,7 @@ namespace Config.Entities
public virtual int AltProcPeriod { get; set; } /// Period of alternative procedures (0 = no alt. procedure)
public virtual float DN { get; set; } /// Not mapped to DB, valid in ProceduresCtrl for procedure filtering only
public virtual float Qn { get; set; } /// - ' ' -
public virtual double Qn { get; set; } /// - ' ' -
public virtual string MClass { get; set; } /// - ' ' -
public virtual string Producer { get; set; } /// - ' ' -
@@ -75,7 +75,7 @@ namespace Config.Entities
///
/// Default values
///
CreationUser = Common.GlobalData.GetCurrentUserName();
CreationUser = Common.CurrentUser.UserName();
CreationTime = DateTime.Now;
LastChgUser = CreationUser;
LastChgTime = CreationTime;
+5 -2
View File
@@ -36,7 +36,7 @@ namespace Config.Entities
///
/// Default values
///
CreationUser = GlobalData.GetCurrentUserName();
CreationUser = CurrentUser.UserName();
CreationTime = DateTime.Now;
LastChgUser = CreationUser;
LastChgTime = CreationTime;
@@ -78,6 +78,8 @@ namespace Config.Entities
output.WriteLine(CreationTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(LastChgUser);
output.WriteLine(LastChgTime.ToString(CultureInfo.InvariantCulture));
output.WriteLine(((sbyte)ProfileType).ToString());
output.WriteLine(((sbyte)ErrorLimitType).ToString());
foreach (var test in Tests) { test.Export(output); }
output.WriteLine();
@@ -96,7 +98,8 @@ namespace Config.Entities
result.CreationTime = DateTime.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
result.LastChgUser = input.ReadLine();
result.LastChgTime = DateTime.Parse(input.ReadLine(), CultureInfo.InvariantCulture);
string line = input.ReadLine();
result.ProfileType = (ProfileType)sbyte.Parse(input.ReadLine());
result.ErrorLimitType = (ErrorLimitType)sbyte.Parse(input.ReadLine());
while (true)
{
+57 -36
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -19,14 +19,15 @@ 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 TestProfile Profile { get; set; } /// UserDefined, Protected, UserDefinedHeatMeter, ProtectedHeatMeter
public virtual TestProfile Profile { get; set; } /// UserDefined, UserDefinedCompound, UserDefinedHeatMeter, Protected, ProtectedCompound, 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 TestTime { get; set; } /// Test time (estimate) in [s]
public virtual double Qtg { get; set; } /// When == -1 => Qtg is determined by the test method, otherwise Qtg is in [m3/h],
public virtual double Qfrom { get; set; } /// Water flow low limit in [m3/h] or in [%] of Qtg
public virtual double Qto { get; set; } /// Water flow high limit in [m3/h] or in [%] of Qtg
public virtual bool IsFromToInPct { get; set; } /// true: Qfrom and Qto are in % of Qtg, false: Qfrom and Qto are in [m3/h]
public virtual double Volume { get; set; } /// Test volume (target) in [l]
public virtual double TestTime { get; set; } /// Test time (estimate) in [s]
public virtual string Method { get; set; }
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
@@ -34,10 +35,10 @@ namespace Config.Entities
public virtual int Repeats { get; set; }
public virtual bool DoDraining { 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
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual string TempControl { get; set; } /// Water temperature controller, null or empty = Do not control water temp
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
public virtual MassMethod MassMethod { get; set; } /// method of mass. measurement at the beginning/end of test: false=slow (precise), true=using immediate mass measurement and evaluation
@@ -57,6 +58,11 @@ namespace Config.Entities
public virtual string TransBetween { get; set; }
public virtual string TransAfter { get; set; }
public virtual IList<ComponentTest> MoreParams { get; set; }
public virtual Procedure Procedure { get; set; }
/// Additional stuff not mapped into the database
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database
@@ -72,12 +78,17 @@ namespace Config.Entities
public virtual Unit TempUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual Unit PressUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual Unit LengthUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual Unit ElectricUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
public virtual IList<ComponentTest> MoreParams { get; set; }
public virtual Procedure Procedure { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
/// Wrappers
public virtual double QfromM3ph()
{
return !IsFromToInPct ? Qfrom : Qtg >= 0 ? Qtg * Qfrom / 100 : 0;
}
public virtual double QtoM3ph()
{
return !IsFromToInPct ? Qto : Qtg >= 0 ? Qtg * Qto / 100 : 0;
}
public Test()
{
@@ -90,15 +101,16 @@ namespace Config.Entities
Profile = TestProfile.UserDefined;
Publish = (sbyte)Common.Publish.Always;
DoEvaluate = true;
Repeats = 1;
IsFromToInPct = false;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
Repeats = 1;
DoDraining = false;
DoDrainingAfter = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
TempControl = string.Empty;
PumpPower = 60.0f; /// [%]
MassRepeats = 0; /// default
MassSpread = 0; /// default
@@ -159,7 +171,8 @@ namespace Config.Entities
result.Qtg = Qtg;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Volume = Volume;
result.IsFromToInPct = IsFromToInPct;
result.Volume = Volume;
result.TestTime = TestTime;
result.Method = Method;
result.ErrLimLo = ErrLimLo;
@@ -168,10 +181,10 @@ namespace Config.Entities
result.Repeats = Repeats;
result.DoDraining = DoDraining;
result.DoDrainingAfter = DoDrainingAfter;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PumpPower = PumpPower;
result.TempControl = TempControl;
result.PumpPower = PumpPower;
result.MassRepeats = MassRepeats;
result.MassSpread = MassSpread;
result.MassMethod = MassMethod;
@@ -192,10 +205,12 @@ namespace Config.Entities
result.TransAfter = TransAfter;
result.VolumeUnit = VolumeUnit;
result.FlowUnit = FlowUnit;
result.FlowUnit = FlowUnit;
result.MassUnit = MassUnit;
result.TempUnit = TempUnit;
result.PressUnit = PressUnit;
result.LengthUnit = LengthUnit;
result.ElectricUnit = ElectricUnit;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
return result;
@@ -212,6 +227,7 @@ namespace Config.Entities
output.WriteLine(Qtg.ToString(ci));
output.WriteLine(Qfrom.ToString(ci));
output.WriteLine(Qto.ToString(ci));
output.WriteLine(IsFromToInPct.ToString());
output.WriteLine(Volume.ToString(ci));
output.WriteLine(TestTime.ToString(ci));
output.WriteLine(Method);
@@ -221,10 +237,10 @@ namespace Config.Entities
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoDrainingAfter.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine((TempControl != null) ? TempControl : string.Empty);
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(MassRepeats.ToString(ci));
output.WriteLine(MassSpread.ToString(ci));
output.WriteLine(((byte)MassMethod).ToString(ci));
@@ -261,11 +277,12 @@ namespace Config.Entities
tst.Part = int.Parse(input.ReadLine(), ci);
tst.Publish = sbyte.Parse(input.ReadLine(), ci);
tst.DoEvaluate = bool.Parse(input.ReadLine());
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.TestTime = float.Parse(input.ReadLine(), ci);
tst.Qtg = double.Parse(input.ReadLine(), ci);
tst.Qfrom = double.Parse(input.ReadLine(), ci);
tst.Qto = double.Parse(input.ReadLine(), ci);
tst.IsFromToInPct = bool.Parse(input.ReadLine());
tst.Volume = double.Parse(input.ReadLine(), ci);
tst.TestTime = double.Parse(input.ReadLine(), ci);
tst.Method = input.ReadLine();
tst.ErrLimLo = float.Parse(input.ReadLine(), ci);
tst.ErrLimHi = float.Parse(input.ReadLine(), ci);
@@ -273,10 +290,10 @@ namespace Config.Entities
tst.Repeats = int.Parse(input.ReadLine(), ci);
tst.DoDraining = 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);
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.TempControl = input.ReadLine();
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.MassRepeats = int.Parse(input.ReadLine(), ci);
tst.MassSpread = float.Parse(input.ReadLine(), ci);
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine(), ci);
@@ -293,8 +310,11 @@ namespace Config.Entities
tst.TransBetween = 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
: line.Equals(TestProfile.ProtectedCompound.ToString()) ? TestProfile.ProtectedCompound
: line.Equals(TestProfile.Protected.ToString()) ? TestProfile.Protected
: line.Equals(TestProfile.UserDefinedHeatMeter.ToString()) ? TestProfile.UserDefinedHeatMeter
: line.Equals(TestProfile.UserDefinedCompound.ToString()) ? TestProfile.UserDefinedCompound
: TestProfile.UserDefined; /// UserDefined is the default
tst.TransAfter = input.ReadLine();
while (true)
@@ -327,6 +347,7 @@ namespace Config.Entities
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 != IsFromToInPct.ToString()) { diff.AppendFormat(fmt, "IsFromToInPct", IsFromToInPct.ToString(), ln); };
ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TestTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TestTime.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); };
@@ -334,11 +355,11 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Uncertainty.ToString(ci)) { diff.AppendFormat(fmt, "Uncertainty", Uncertainty.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "DoDraining", DoDraining.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "DoDrainingAfter", DoDrainingAfter.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString()) { diff.AppendFormat(fmt, "DoDraining", DoDraining.ToString(), ln); };
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString()) { diff.AppendFormat(fmt, "DoDrainingAfter", DoDrainingAfter.ToString(), 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 != TempControl) { diff.AppendFormat(fmt, "TempController", TempControl, ln); };
ln = inp.ReadLine(); if (ln != PumpPower.ToString(ci)) { diff.AppendFormat(fmt, "PumpPower", PumpPower.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassRepeats.ToString(ci)) { diff.AppendFormat(fmt, "MassRepeats", MassRepeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassSpread.ToString(ci)) { diff.AppendFormat(fmt, "MassSpread", MassSpread.ToString(ci), ln); };
+2 -2
View File
@@ -157,14 +157,14 @@ namespace Config.Entities
/// <returns></ returns>
public virtual bool IsPasswordExpired()
{
if (IsPowerUser() || IsMemberOf(GID.Administrators) || GlobalData.PasswdExpirationPeriodDays == 0)
if (IsPowerUser() || IsMemberOf(GID.Administrators) || CurrentUser.PasswdExpirationPeriodDays == 0)
{
/// Password cannot expirate for this user or this feature is disabled in Backup and Security options
return false;
}
/// Password expiration time is 3 months
return (DateTime.Now - LastPwChange > new TimeSpan(GlobalData.PasswdExpirationPeriodDays, 0, 0, 0));
return (DateTime.Now - LastPwChange > new TimeSpan(CurrentUser.PasswdExpirationPeriodDays, 0, 0, 0));
}
/// <summary>
+9 -8
View File
@@ -28,13 +28,13 @@ namespace Config
switch (dbType)
{
default:
case DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
case DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break;
}
case DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
}
switch (database)
{
@@ -105,11 +105,11 @@ namespace Config
///
var admin = new Config.Entities.User
{
UserName = GlobalData.AdminUsername,
UserName = CurrentUser.AdminUsername,
FullName = Strings.Administrator,
LastPwChange = DateTime.Now
};
admin.SetPassword(GlobalData.AdminPassword);
admin.SetPassword(CurrentUser.AdminPassword);
///
/// Prepare all groups, add some of them to admin
@@ -128,10 +128,11 @@ namespace Config
case GID.Administrators:
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
case GID.TraceabilityManagement:
#elif KEMPNO_50 || KRAKOW_50 || TORUN_50 || WARSAW_END
//#elif LANG_PL
#endif
case GID.MetrologicalAuthority:
case GID.WaterMeterAuthority:
#endif
admin.AddGroup(group);
session.SaveOrUpdate(group); /// Save this group
break;
+410
View File
@@ -0,0 +1,410 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Common;
//formulas.cs has been added cause iPerl from master-2 ...MF
namespace Config
{
public static class Formulas
{
private static readonly ILog log = LogManager.GetLogger(typeof(Formulas));
///
/// 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
/// </summary>
static Formulas()
{
///
/// Initialize tables to calculate specific enthalpies
///
Ii = new int[34] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 8, 8, 21, 23, 29, 30, 31, 32 };
Ji = new int[34] { -2, -1, 0, 1, 2, 3, 4, 5, -9, -7, -1, 0, 1, 3, -3, 0, 1, 3, 17, -4, 0, 6, -5, -2, 10, -8, -11, -6, -29, -31, -38, -39, -40, -41 };
ni = new double[34] {
0.14632971213167, /// 1
-0.84548187169114, /// 2
-0.37563603672040E1, /// 3
0.33855169168385E1, /// 4
-0.95791963387872, /// 5
0.15772038513228, /// 6
-0.16616417199501E-1, /// 7
0.81214629983568E-3, /// 8
0.28319080123804E-3, /// 9
-0.60706301565874E-3, /// 10
-0.18990068218419E-1, /// 11
-0.32529748770505E-1, /// 12
-0.21841717175414E-1, /// 13
-0.52838357969930E-4, /// 14
-0.47184321073267E-3, /// 15
-0.30001780793026E-3, /// 16
0.47661393906987E-4, /// 17
-0.44141845330846E-5, /// 18
-0.72694996297594E-15, /// 19
-0.31679644845054E-4, /// 20
-0.28270797985312E-5, /// 21
-0.85205128120103E-9, /// 22
-0.22425281908000E-5, /// 23
-0.65171222895601E-6, /// 24
-0.14341729937924E-12, /// 25
-0.40516996860117E-6, /// 26
-0.12734301741641E-8, /// 27
-0.17424871230634E-9, /// 28
-0.68762131295531E-18, /// 29
0.14478307828521E-19, /// 30
0.26335781662795E-22, /// 31
-0.11947622640071E-22, /// 32
0.18228094581404E-23, /// 33
-0.93537087292458E-25, /// 34
};
///
/// Initialize a table to calculate temperature of a platinum thermometer from resistance
///
Di = new double[]
{
439.932854,
472.418020,
37.684494,
7.472018,
2.920828,
0.005184,
-0.963864,
-0.188732,
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 (obsolete)
/// </summary>
/// <param name="t">IPTS-68 temperature in [°C]</param>
/// <returns>Density in [kg/m3]</returns>
public static double DistilledWaterDensityFromTempIPTS68(double t)
{
const double a0 = 999.842594;
const double a1 = 0.06793952;
const double a2 = -0.009095290;
const double a3 = 0.0001001685;
const double a4 = -0.000001120083;
const double a5 = 6.536332e-09;
return ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t + a0;
}
/// <summary>
/// Calculate density by comparing calculated data and data from a certificate
/// </summary>
/// <param name="realDensity">Density from a certificate in [kg/m3]</param>
/// <param name="atTemperature">Temperature from a certificate in [°C]</param>
/// <returns>Density correction in [kg/m3]</returns>
public static double DensityCorrection(double realDensity, double atTemperature)
{
/// Calculated data
double calculatedDensity = DistilledWaterDensityFromTemp(atTemperature);
return realDensity - calculatedDensity;
}
/// <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 WaterDensityFromTemp(double t)
{
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 * Units.ConvertTo(Unit.Pa, pressure));
}
public static float AirDensityFromAmbientVales(float tempC, float pressureBar, float humiPct)
{
double pressurePa = 100000.0 * (double)pressureBar; /// [Pa]
double tempKelvin = 273.15 + (double)tempC;
double coef1 = 1.2811805 / 10000.0 * tempKelvin * tempKelvin
- 1.950987 / 100.0 * tempKelvin
+ 34.04926034
- 6.353631 * 1000.0 / tempKelvin;
double coef3 = humiPct / 100.0 * System.Math.Exp(coef1) / pressurePa;
double airDensityKgm3 = 0.00348353 * pressurePa * (1.0 - 0.378 * coef3) / tempKelvin; /// kg/m3
return (float)airDensityKgm3;
}
/// <summary>
/// Convert 'pulses' to 'volume', prevent division by zero
/// </summary>
public static double VolumeFromPulses(int pulses, double pulsesPerLiter)
{
if (pulsesPerLiter <= double.Epsilon) return 0;
return Convert.ToDouble(pulses) / pulsesPerLiter;
}
/// <summary>
/// Calculate the error in % from 'measured' and 'true' volume, prevent division by zero
/// </summary>
public static double ErrorFromVolumes(double measuredVolume, double trueVolume)
{
if (-float.Epsilon <= trueVolume && trueVolume <= float.Epsilon)
{
if (-float.Epsilon <= measuredVolume && measuredVolume <= float.Epsilon)
{
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 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<IMeasurementCorrection> corrections)
{
return rawValue + GetCorrection(rawValue, corrections);
}
/// <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<IMeasurementCorrection> corrections)
{
if ((corrections == null) || (corrections.Count == 0)) return 0; /// No correction
if (rawValue < corrections[0].Measurement)
{
/// rawValue is below the lowest value in the correction table
return corrections[0].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>
/// Calculates the heat coefficient for water
/// </summary>
/// <param name="pressure">Pressure [bar]</param>
/// <param name="T_in">Inlet temperature [°C]</param>
/// <param name="T_out">Outlet temperature [°C]</param>
/// <param name="flowMeasuredAtInlet">true = flow measured @inlet, false = flow measured @outlet</param>
/// <returns> Heat coefficient for water [J/(m3 K)]</returns>
public static double HeatCoefficientWater(double pressure, double T_in, double T_out, bool flowMeasuredAtInlet)
{
if (T_in == T_out) return 0;
const double R = 461.526; /// [J kg^-1 K^-1]
const double p_star_Pa = 16.53E6; /// [Pa] (=16.53 MPa)
const double T_star = 1386.0; /// [K]
double T_in_K = Units.ConvertTo(Unit.K, T_in);
double T_out_K = Units.ConvertTo(Unit.K, T_out);
double tau_in = T_star / T_in_K;
double tau_out = T_star / T_out_K;
double pi = Units.ConvertTo(Unit.Pa, pressure) / p_star_Pa;
double h_in = tau_in * GammaTau(pi, tau_in) * R * T_in_K;
double h_out = tau_out * GammaTau(pi, tau_out) * R * T_out_K;
double ni = flowMeasuredAtInlet ? GammaPi(pi, tau_in) * R * T_in_K / p_star_Pa
: GammaPi(pi, tau_out) * R * T_out_K / p_star_Pa;
return (h_in - h_out) / (ni * (T_in - T_out));
}
/// <summary>
/// gamma(pi) see also STN EN 1434-1 Annex A (A.4)
/// </summary>
/// <param name="pi">pi = p / p* where p* = 16.53 MPa</param>
/// <param name="tau">tau = T* / T where T* = 1386 K</param>
/// <returns>gamma(pi)</returns>
static double GammaPi(double pi, double tau)
{
double result = 0;
for (int i = 0; i < 34; i++)
{
result -= ni[i] * Ii[i] * Math.Pow(7.1 - pi, Ii[i] - 1) * Math.Pow(tau - 1.222, Ji[i]);
}
return result;
}
/// <summary>
/// gamma(tau) see also STN EN 1434-1 Annex A (A.7)
/// </summary>
/// <param name="pi">pi = p / p* where p* = 16.53 MPa</param>
/// <param name="tau">tau = T* / T where T* = 1386 K</param>
/// <returns>gamma(tau)</returns>
static double GammaTau(double pi, double tau)
{
double result = 0;
for (int i = 0; i < 34; i++)
{
result += ni[i] * Math.Pow(7.1 - pi, Ii[i]) * Ji[i] * Math.Pow(tau - 1.222, Ji[i] - 1);
}
return result;
}
/// <summary>
/// Conversion of measured resistance of a platinum thermometer to temperature according to ITS-90
/// </summary>
/// <param name="R">Measured resistance in [°C]</param>
/// <param name="R001C">Calibrated resistance in Ohm at 0.01°C</param>
/// <param name="a7">Calibrated ITS-90 coefficient a7</param>
/// <param name="b7">Calibrated ITS-90 coefficient b7</param>
/// <param name="c7">Calibrated ITS-90 coefficient c7</param>
/// <returns>Temperature in [°C]</returns>
public static double PlatinumResistanceTM_ITS90_R2T(double R, double R001C, double a7, double b7, double c7)
{
double w = R / R001C; /// ratio
double r1 = w - 1.0;
double dw = r1 * (a7 + r1 * (b7 + r1 * c7)); /// = a7*r1 + b7*r1^2 + c7*r1^3
double wr = w - dw;
double x = (wr - 2.64) / 1.64;
double sum = 0;
for (int i = Di.Length - 1; i >= 0; i--)
{
sum = sum * x + Di[i];
}
return sum;
}
/// <summary>
/// Conversion of measured resistance of a platinum thermometer to temperature using Callendar-Van Dusen equations
/// </summary>
/// <param name="R">Measured resistance in [°C]</param>
/// <param name="R0">Calibrated resistance in Ohm at 0°C</param>
/// <param name="A">Calibration coefficient a</param>
/// <param name="B">Calibration coefficient b</param>
/// <returns>Temperature in [°C]</returns>
public static double PlatinumResistanceTM_ITS27_R2T(double R, double R0, double A, double B)
{
if (R0 * R0 * A * A - 4 * R0 * B * (R0 - R) <= 0) return 0; /// Out of range
return (-(R0 * A) + Math.Sqrt(R0 * R0 * A * A - 4 * R0 * B * (R0 - R))) / (2 * R0 * B);
}
}
}
+3
View File
@@ -21,6 +21,9 @@ namespace Config.Mappings
Map(x => x.PressMtrUp);
Map(x => x.PressMtrDown);
Map(x => x.PressMtrDelta);
//Map(x => x.ElectricMtrUp);
//Map(x => x.ElectricMtrDown);
//Map(x => x.ElectricMtrDelta);
Map(x => x.StopBFValve);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
+2 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -19,7 +19,7 @@ namespace Config.Mappings
Map(x => x.LogLevel);
Map(x => x.Parameters)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
.CustomSqlType("varchar(12000)");
HasMany(x => x.Corrections)
.OrderBy("Measurement")
.Cascade.All();
+4 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -17,12 +17,14 @@ namespace Config.Mappings
Map(x => x.Qto);
Map(x => x.Selector);
Map(x => x.RegValve);
Map(x => x.FlowMeter);
Map(x => x.RegulMinStep).Nullable();//older databases may not have this column
Map(x => x.FlowMeter);
Map(x => x.PidCoef);
Map(x => x.StartValve);
Map(x => x.Diverter);
Map(x => x.TempMtrDiv);
Map(x => x.Scale);
Map(x => x.RegVPositions);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
+3 -1
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
/// Copyright (c) 2019-2023 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -14,6 +14,7 @@ namespace Config.Mappings
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.FlowId);
Map(x => x.CoefQfrom);
Map(x => x.CoefQto);
Map(x => x.ErrLimLo);
@@ -24,6 +25,7 @@ namespace Config.Mappings
Map(x => x.PressLimHi);
Map(x => x.Publish);
Map(x => x.Evaluate);
Map(x => x.Method);
Map(x => x.E1);
Map(x => x.E2);
Map(x => x.E3);
+5 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2023 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -20,15 +20,16 @@ namespace Config.Mappings
Map(x => x.Qtg);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.IsFromToInPct);
Map(x => x.Volume);
Map(x => x.TestTime);
Map(x => x.Repeats);
Map(x => x.DoDraining);
Map(x => x.DoDrainingAfter);
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PumpPower);
Map(x => x.TempControl);
Map(x => x.PumpPower);
Map(x => x.MassRepeats);
Map(x => x.MassSpread);
Map(x => x.MassMethod)
+7
View File
@@ -0,0 +1,7 @@
namespace Config
{
public class PurchaseResources
{
}
}
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Decrypt
{
if ((args.Length < 1) || !File.Exists(args[0]))
{
Console.WriteLine("Usage: Decode <file>");
Console.WriteLine(@"Usage: Decode <file>");
Console.ReadKey();
return;
}
+2 -3
View File
@@ -40,9 +40,8 @@
<StartupObject>DeviceTest.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
+32 -15
View File
@@ -423,7 +423,7 @@ namespace DeviceTest
{
parentCfg = parentFactory.DefaultConfig();
}
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg(this);
cfgForm.CmpntEntities = new List<Config.Entities.Component>();
IComponentCfgCtrl cfgControl = parentCfg.GetControl(cfgForm.CmpntEntities);
@@ -452,7 +452,7 @@ namespace DeviceTest
{
component1Cfg = component1Factory.DefaultConfig();
}
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg(this);
///
var compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
@@ -486,7 +486,7 @@ namespace DeviceTest
{
component2Cfg = component2Factory.DefaultConfig();
}
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg(this);
///
var compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
@@ -521,7 +521,7 @@ namespace DeviceTest
{
component3Cfg = component3Factory.DefaultConfig();
}
ComponentParametersDlg cfgForm = new ComponentParametersDlg();
ComponentParametersDlg cfgForm = new ComponentParametersDlg(this);
///
var compEntities = new List<Config.Entities.Component>();
if (parentFactory != null && parentCfg != null) compEntities.Add(parentCfg.CreateDbEntity());
@@ -678,11 +678,16 @@ namespace DeviceTest
{
operation1 = (tbfComponent1forOp as TBF.Rig.Network.Camera.Roi.Roi).RoiDetectionOp();
}
else if (tbfComponent1forOp is TBF.Rig.Modbus.Easytherm.Easytherm)
else if (tbfComponent1forOp is TBF.Rig.Modbus.TempControl.Easytherm.TControl)
{
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent1forOp is TBF.Rig.Modbus.TempControl.Novus.TControl)
{
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent1forOp is TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
@@ -717,11 +722,16 @@ namespace DeviceTest
{
operation21 = (tbfComponent2forOp as TBF.Rig.Network.Camera.Roi.Roi).RoiDetectionOp();
}
else if (tbfComponent2forOp is TBF.Rig.Modbus.Easytherm.Easytherm)
else if (tbfComponent2forOp is TBF.Rig.Modbus.TempControl.Easytherm.TControl)
{
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent2forOp is TBF.Rig.Modbus.TempControl.Novus.TControl)
{
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent2forOp is TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
@@ -756,11 +766,16 @@ namespace DeviceTest
{
operation31 = (tbfComponent3forOp as TBF.Rig.Network.Camera.Roi.Roi).RoiDetectionOp();
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.Easytherm.Easytherm)
{
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.Easytherm.Easytherm).SetTemperatureOp(20);
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.TempControl.Easytherm.TControl)
{
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.TempControl.Novus.TControl)
{
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter)
{
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter).ReadLevelOp(ref dblBox1);
@@ -884,6 +899,8 @@ namespace DeviceTest
{
Cursor = Cursors.WaitCursor;
CurrentUser.Restore(this);
if (workerThread != null)
{
workerThreadRunning = false;
+27 -2
View File
@@ -1,3 +1,28 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.15" targetFramework="net472" />
</packages>
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Encrypt
{
if ((args.Length < 1) || !File.Exists(args[0]))
{
Console.WriteLine("Usage: Encode <file>");
Console.WriteLine(@"Usage: Encode <file>");
Console.ReadKey();
return;
}
+1 -1
View File
@@ -291,7 +291,7 @@ namespace EventViewer
{
try
{
GlobalData.RemoteUsersDB = new DBSettings(DBType.MySql, Program.LocalSettings.UsersDBConnString);
CurrentUser.RemoteUsersDB = new DBSettings(DBType.MySql, Program.LocalSettings.UsersDBConnString);
SharedDatabase.Forms.LoginDlg dlg = new SharedDatabase.Forms.LoginDlg();
if (dlg.ShowDialog() == DialogResult.OK)
{

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