Skip to content

Editable Power Factor and Nominal VA for watts calculation - #241

Open
merodahero wants to merge 2 commits into
nutdotnet:dev-2.3from
merodahero:feat/cal-power-factor-and-apparent-power
Open

Editable Power Factor and Nominal VA for watts calculation#241
merodahero wants to merge 2 commits into
nutdotnet:dev-2.3from
merodahero:feat/cal-power-factor-and-apparent-power

Conversation

@merodahero

Copy link
Copy Markdown

feat(client): editable Power Factor and Nominal VA for watts calculation

Adds two new settings under the existing CAL namespace:

  • CAL_PowerFactor (Double, default 0.95)
  • CAL_ApparentPowerNom (Int32, default 2400)

The Schneider Easy UPS SRVSPM3KIL (and many other online-double-
conversion units) does not publish ups.realpower through the apcsmart
driver, so WinNUT-Client falls back to its computed methods. The
hardcoded POWER_FACTOR = 0.8 in UPS_Device.vb under-reads by ~15%.

The new settings let users override both:

  • POWER_FACTOR feeds OutputVACalc and InputNomVALoadPct
  • CAL_ApparentPowerNom backs up RPNomLoadPct when the unit does
    not publish ups.realpower.nominal

Defaults are tuned for online-double-conversion UPSes. To keep the
Common assembly free of My.Settings (which is scoped to the Client
project only), the values flow through a public shared
UPS_Device.RuntimeConfig class that the Client project populates
from My.Settings at UPS_Device instantiation.

Wire-frame in Pref_Gui: two new NumericUpDown controls (PF:
0.00–1.00, ApparentNomVA: 0–100000) added to the existing CAL tab.

Adds two new settings under the existing CAL namespace:

  - CAL_PowerFactor (Double, default 0.95)
  - CAL_ApparentPowerNom (Int32, default 2400)

The Schneider Easy UPS SRVSPM3KIL (and many other online-double-
conversion units) does not publish ups.realpower through the apcsmart
driver, so WinNUT-Client falls back to its computed methods. The
hardcoded POWER_FACTOR = 0.8 in UPS_Device.vb under-reads by ~15%.

The new settings let users override both:
  - POWER_FACTOR feeds OutputVACalc and InputNomVALoadPct
  - CAL_ApparentPowerNom backs up RPNomLoadPct when the unit does
    not publish ups.realpower.nominal

Defaults are tuned for online-double-conversion UPSes. To keep the
Common assembly free of My.Settings (which is scoped to the Client
project only), the values flow through a public shared
UPS_Device.RuntimeConfig class that the Client project populates
from My.Settings at UPS_Device instantiation.

Wire-frame in Pref_Gui: two new NumericUpDown controls (PF:
0.00–1.00, ApparentNomVA: 0–100000) added to the existing CAL tab.
@merodahero merodahero closed this Jul 21, 2026
@merodahero
merodahero deleted the feat/cal-power-factor-and-apparent-power branch July 21, 2026 15:51
@gbakeman

Copy link
Copy Markdown
Contributor

Hi @merodahero, any particular reason you closed this PR? It's a requested feature by our users and something I was looking forward to merging. Thank you for the work regardless though.

@gbakeman gbakeman added the enhancement New feature or request label Jul 21, 2026
@merodahero
merodahero restored the feat/cal-power-factor-and-apparent-power branch July 21, 2026 22:08
@merodahero

Copy link
Copy Markdown
Author

@gbakeman i was just playing around and didnt think it would be needed :D ill re open

@merodahero merodahero reopened this Jul 21, 2026
…ference

Restores NuGet resolution for .NET Framework 4.x targets on modern
NuGet clients (5.0+). Both vbproj files were missing the explicit
PackageReference, causing intermittent NU1605 'No warning' / NU1701
errors during restore on systems where the legacy GAC fallback isn't
available.

The 1.0.3 version is the latest stable; matches the locked assembly
versions referenced elsewhere in the project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants