Open
Conversation
…oltage/current Show Charge now adds a charge plot alongside existing plots instead of replacing them. Unchecking charge removes only the charge plot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
You already fixed the issue I noted on #248. What does this fix? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes (beyond #248)
PR #248 added charge plotting and fixed the initial issue you reported (Show Charge hiding voltage/current). However, the
showCharge()implementation directly adds/removes plots from the list, unlikeshowVoltage()/showCurrent()which use boolean flags (showV/showI) filtered bycalcVisiblePlots(). This mismatch causes three remaining bugs:setValue()destroys charge plots. Toggling scope values (e.g. clicking "Show Resistance") callssetValue(), which rebuilds theplotsvector from scratch. Charge plots are lost becauseaddValue()doesn't know to re-add them. With ashowCflag,addValue()can restore the charge plot after a rebuild.Charge state not persisted on save/load.
getFlags()/setFlags()don't include charge state, so saving a circuit and reloading it loses the "Show Charge" setting.No visibility toggle — only add/destroy. Unchecking "Show Charge" removes the plot entirely and calls
resetGraph(), destroying accumulated data. Voltage and current instead just toggle visibility viashowV/showIwithout removing the underlying plot data.Fix
Adds a
showCboolean flag that mirrors the existingshowV/showIpattern:showCharge()setsshowCand adds the plot if needed, but no longer removes plots or resets the graphcalcVisiblePlots()filtersUNITS_Cplots byshowC(likeUNITS_V/showVandUNITS_A/showI)addValue()re-adds the charge plot whenshowCis true after asetValue()rebuildinitialize()detects existing charge plots and setsshowCgetFlags()/setFlags()persistshowCusing bit 1<<23ScopePropertiesDialog.updateUi()readsscope.showCinstead ofscope.hasPlotValue()Steps to reproduce the bugs (on current v3-dev)
🤖 Generated with Claude Code