Skip to content

Pneumatic Valve Suite Dependency Updates#8491

Draft
Copilot wants to merge 2 commits into
developfrom
copilot/amo-8490-update-web-assembly-bindings
Draft

Pneumatic Valve Suite Dependency Updates#8491
Copilot wants to merge 2 commits into
developfrom
copilot/amo-8490-update-web-assembly-bindings

Conversation

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor

Implements the AMO-Tools-Desktop side of the MEASUR-Tools-Suite pneumatic valve refactor (Suite PR #341), replacing the old class-based WASM binding with two standalone functions and wiring up a new calculator UI.

Checklist

  • Variable, function, and class names are descriptive
  • Code leverages existing architecture, helper methods, and shared modules when applicable
  • Development artifacts such as console logs, test values, and comments have been removed
  • All Copilot, Claude Code, or other LLM implementations have been reviewed as if contributed by another developer
  • UI changes have been manually tested for usability and appearance
  • This PR references the related issue number (if applicable), ex. issue -> #8490

Description

API Binding Changes

Old class-based pattern removed, replaced with two direct WASM function calls:

// Before (old class constructor pattern — now removed from suite)
const pv = new ToolsSuiteModule.PneumaticValve(inletPressure, outletPressure);
const result = pv.calculate(); // → number
pv.delete();

// After
const result = ToolsSuiteModule.calculatePneumaticValveFlowRate({ inletPressure, outletPressure });
// result.flowRate → scfm

const cvResult = ToolsSuiteModule.calculatePneumaticValveCv({ inletPressure, outletPressure, flowRate });
// cvResult.flowCoefficient → dimensionless Cv
  • standalone.ts: Replaced commented-out PneumaticValve interface with PneumaticValveFlowRateInput/Output and PneumaticValveCvInput/Output
  • standalone-suite-api.service.ts: Implemented pneumaticValveCalculateFlowRate() and pneumaticValveCv() against the new WASM functions
  • standalone.service.ts: Added Imperial/Metric unit conversion wrappers (psia↔kPaa, scfm↔Nm³/min)

New Calculator UI (/calculators/pneumatic-valve)

Two-mode calculator following the existing compressed air calculator pattern:

  • Flow Rate (Cv = 1) — given inlet/outlet absolute pressures, returns theoretical flow rate for a unit-Cv valve; multiply by actual Cv to get real flow
  • Flow Coefficient (Cv) — given pressures and measured flow rate, returns Cv for valve selection

Help panel includes per-field descriptions and a link to the suite documentation at group__pneumatic__valve__calculator.

Registration

  • compressed-air.module.ts — imports PneumaticValveModule
  • core.routing.ts — adds pneumatic-valve route
  • analyticsEventTypes.ts — adds calculator-CA-pneumatic-valve
  • Compressed air calculator list page and sidebar updated
  • docs/calculator_list.md — entry added with Docs link

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.

2 participants