Integrate ImpedenceFinder closed-form Z0 into the project Impedance tab.
Use the vendored Hammerstad-Jensen/Cohn engine for microstrip, stripline, and coupled-diff advice. Skip OpenEMS/pcbnew and refuse CPWG rather than inventing a number. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,9 @@ import type {
|
||||
CreditSnapshot,
|
||||
DesignGraph,
|
||||
DeratingRow,
|
||||
ImpedanceKind,
|
||||
ImpedanceStackupResult,
|
||||
ImpedanceTraceResult,
|
||||
EdifSubDesign,
|
||||
FindingComment,
|
||||
LcscPayload,
|
||||
@@ -582,6 +585,28 @@ export async function fetchDerating(
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function computeImpedance(body: {
|
||||
mode: "trace" | "stackup";
|
||||
kind?: ImpedanceKind;
|
||||
h: number;
|
||||
er: number;
|
||||
t: number;
|
||||
w?: number | null;
|
||||
s?: number | null;
|
||||
target_z?: number | null;
|
||||
}): Promise<ImpedanceTraceResult | ImpedanceStackupResult> {
|
||||
const res = await authFetch(`${BASE}/api/impedance`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
if (!res.ok) {
|
||||
const detail = await res.json().catch(() => ({ detail: res.statusText }));
|
||||
throw new Error(typeof detail.detail === "string" ? detail.detail : "Impedance compute failed");
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function fetchReport(
|
||||
projectId: string,
|
||||
): Promise<ValidationReport> {
|
||||
|
||||
Reference in New Issue
Block a user