Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ObjectAcConnection to fetch /Ac/PvOn* phase totals #1909

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blammit
Copy link
Contributor

@blammit blammit commented Feb 17, 2025

The /Ac/PvOnGrid, /Ac/PvOnGenset and /Ac/PvOnOutput values may change frequently, so the PvMonitor implementation was sub-optimal as it re-calculated the phase totals for these values whenever a single phase value was changed.

Use ObjectAcConnection to monitor these values instead, as that only calculates the totals once per second.

Fixes #1908

@blammit blammit force-pushed the blam/1908-use-objectacconnection-to-fetch-acpvon-phase-totals branch from 8805693 to d32b575 Compare February 17, 2025 03:39
}
}
onPhaseCountChanged: Qt.callLater(root._updateMaximumPhaseCount)
onPowerChanged: Qt.callLater(root._updateAcTotals)
Copy link
Contributor

@chriadam chriadam Feb 17, 2025

Choose a reason for hiding this comment

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

is there an assumption that if the current changes, the power will also change, which is why you don't also call _updateAcTotals upon onCurrentChanged? (I can imagine a hypothetical example where the power stays the same if the voltage drops very low and current goes very high, which might need to be visualized or whatever)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes this was meant to hook into onCurrentChanged as well. Fixed.

The /Ac/PvOnGrid, /Ac/PvOnGenset and /Ac/PvOnOutput values may change
frequently, so the PvMonitor implementation was sub-optimal as it
re-calculated the phase totals for these values whenever a single
phase value was changed.

Use ObjectAcConnection to monitor these values instead, as that only
calculates the totals once per second.

Fixes #1908
@blammit blammit force-pushed the blam/1908-use-objectacconnection-to-fetch-acpvon-phase-totals branch from d32b575 to 4721818 Compare February 17, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ObjectAcConnection to fetch /Ac/PvOn* phase totals
3 participants