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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.