gui-ts: prevent stale run overwrites and expose model mismatch
Guard async solve updates with run tokens and surface FDM/FEA card length mismatch in Results so users understand when overlays are intentionally reduced. Made-with: Cursor
This commit is contained in:
@@ -122,6 +122,12 @@ export function ResultsTab({
|
||||
}
|
||||
return [fdmSeries.position, fdmSeries.polished, fdmSeries.downhole] as AlignedData;
|
||||
}, [fdm, fea]);
|
||||
const hasCardLengthMismatch = useMemo(() => {
|
||||
const fdmSeries = toSeries(fdm ?? undefined);
|
||||
const feaSeries = toSeries(fea ?? undefined);
|
||||
if (!fdmSeries || !feaSeries) return false;
|
||||
return fdmSeries.position.length !== feaSeries.position.length;
|
||||
}, [fdm, fea]);
|
||||
|
||||
const dynacardOptions = useMemo<Options>(() => {
|
||||
const seriesCount = fea ? 5 : 3;
|
||||
@@ -364,6 +370,11 @@ export function ResultsTab({
|
||||
</Fieldset>
|
||||
|
||||
<Fieldset legend="Dynamometer Card">
|
||||
{hasCardLengthMismatch && (
|
||||
<div className="callout">
|
||||
FDM and FEA card lengths differ; chart overlay is limited to FDM series for this run.
|
||||
</div>
|
||||
)}
|
||||
{dynacardData ? (
|
||||
<UPlotChart data={dynacardData} options={dynacardOptions} height={340} />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user