Skip to content

Conversation

@MichaelHuth
Copy link
Collaborator

@MichaelHuth MichaelHuth commented Dec 8, 2025

This PR will replace #2586. The approach implemented in #2586 is not compatible with PSX.

This PR moves the plotter components into separate functions.
It revises the naming of the plotters panel and subWindows for graphs and tables to follow a common concept. The creation of plot windows is moved inside the plotting loop (before it was done for all windows first), such that after each formula evaluation a new output window is created and reused until the next and is encountered.

This paves the way the add support for operations (like ivscc_apfrequency) that will include a full plotting setup in the output. This needs to be inserted then in the plotting loop.

This PR also fixes some potential bugs that were discovered:

  • handle intermixing of table(x) and regular expressions within the same with block properly when there were multiple formulas contributing to the same table and graph subwindow.
  • Fix retrieval of graph window names for a specific browser for PSX. With the addition of tables the original retrieval function could potentially return a table subwindow from that browser instead of a graph subwindow
  • formulasAreDifferent was not reset in between new graph windows, such that under specific circumstances trace style properties were carried over to the next graph subwindow

@MichaelHuth MichaelHuth self-assigned this Dec 8, 2025
Copilot AI review requested due to automatic review settings December 8, 2025 17:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the sweep formula plotter by extracting plotting logic from the monolithic SF_FormulaPlotter function into two new helper functions: SF_CreateTracesForResultsImpl (which handles the actual trace creation for individual results) and SF_CreateTracesForResults (which orchestrates the trace creation for a set of formula results). This refactoring aims to improve code organization and maintainability while maintaining PSX compatibility.

Key changes:

  • Extracted ~220 lines of plotting logic into new function SF_CreateTracesForResultsImpl
  • Created intermediary function SF_CreateTracesForResults to coordinate between the plotter and implementation
  • Modified annotation and table formula tracking to use wave note indices instead of separate counter variables
  • Added /Z flag to a test wave reference that's expected to be null

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
Packages/tests/Basic/UTF_SweepFormula.ipf Adds /Z flag to wave reference expected to be null, preventing errors
Packages/MIES/MIES_SweepFormula.ipf Major refactoring extracting plotting logic into new helper functions and updating state tracking mechanism

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MichaelHuth MichaelHuth force-pushed the feature/2592-refactor_sf_plotter2 branch from c8ba37e to ced4ebe Compare December 9, 2025 12:51
Copilot AI review requested due to automatic review settings December 9, 2025 14:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 10, 2025 10:44
@MichaelHuth MichaelHuth force-pushed the feature/2592-refactor_sf_plotter2 branch from c15cefd to 08d2acc Compare December 10, 2025 10:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MichaelHuth MichaelHuth force-pushed the feature/2592-refactor_sf_plotter2 branch 2 times, most recently from 47d9f04 to 6f5681f Compare December 10, 2025 15:26
Copilot AI review requested due to automatic review settings December 10, 2025 15:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MichaelHuth MichaelHuth force-pushed the feature/2592-refactor_sf_plotter2 branch from 6f5681f to 73f1fdc Compare December 10, 2025 15:54
@MichaelHuth MichaelHuth assigned t-b and MichaelHuth and unassigned MichaelHuth and t-b Dec 10, 2025
Before the display windows (table/graph) were created before the formulas were evaluated,
now after each formula was evaluated a window is created and filled with traces.

The window naming was unified to use "graph"/"table" suffixes for the base as well as
for the subwindows.

This change allows to react on future operation results with full plotting content.
…indows

- moved SF constants for window suffix and display type to global constants
- extended descriptive code comment for SFH_GetBrowserForFormulaGraph
- renamed SFH_GetFormulaGraphForBrowser to SFH_GetFormulaPanelFromBrowser
as it never returned a graph window (it returned the panel)
- extended SFH_GetFormulaPanelFromBrowser to work also for panels containing table subwindows
- renamed SFH_GetFormulaGraphs to SFH_GetFormulaPlotPanels to reflect actual behavior
and extended the functions code documentation
Copilot AI review requested due to automatic review settings December 10, 2025 20:05
@MichaelHuth MichaelHuth force-pushed the feature/2592-refactor_sf_plotter2 branch from 73f1fdc to 978cd00 Compare December 10, 2025 20:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MichaelHuth MichaelHuth assigned timjarsky and unassigned MichaelHuth Dec 11, 2025
@timjarsky
Copy link
Collaborator

@MichaelHuth, I tested the plotting with PSX; everything looks good.

@timjarsky timjarsky assigned MichaelHuth and unassigned timjarsky Dec 16, 2025
@MichaelHuth MichaelHuth merged commit 0964909 into main Dec 17, 2025
18 checks passed
@MichaelHuth MichaelHuth deleted the feature/2592-refactor_sf_plotter2 branch December 17, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants