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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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
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`.
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`.
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`.
- generate available units using Units.IsQuantity(...)
- use Quantity.MultiFunctionalVariables to populate supported units
- centralize unit selection through Units.GetQuantity()
- 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.
- 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.
- 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.
- 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