Skip to content

Commit 3dc6324

Browse files
committed
Alt/PDE: check for missing solution.
1 parent 8b3da5b commit 3dc6324

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/CAPI/CAPI_Alt.pas

+3-6
Original file line numberDiff line numberDiff line change
@@ -3343,7 +3343,7 @@ function _Alt_PDE_Get_x(pElem: TPDElement; const What: integer; const AllNodes:
33433343
DSS: TDSSContext;
33443344
begin
33453345
Result := 0;
3346-
if not pElem.Enabled then
3346+
if (not pElem.Enabled) or (pElem.NodeRef = NIL) or MissingSolution(pElem) then
33473347
Exit;
33483348

33493349
case What of // MaxCurrent (0), CapacityNorm (1), CapacityEmerg (2), Power (3)
@@ -3371,11 +3371,8 @@ function _Alt_PDE_Get_x(pElem: TPDElement; const What: integer; const AllNodes:
33713371
DSS.SeasonalRating := FALSE; // The user didn't define the seasonal signal
33723372
end;
33733373
Getmem(cBuffer, sizeof(Complex) * pElem.Yorder);
3374-
if pElem.Enabled then
3375-
begin
3376-
pElem.GetCurrents(cBuffer);
3377-
Result := _Alt_PDElements_Get_pctCapacity_for(AllNodes, What, RatingIdx, pElem, cBuffer);
3378-
end;
3374+
pElem.GetCurrents(cBuffer);
3375+
Result := _Alt_PDElements_Get_pctCapacity_for(AllNodes, What, RatingIdx, pElem, cBuffer);
33793376
except
33803377
on E: Exception do
33813378
DoSimpleMsg(DSS, 'Error processing currents: %s', [E.message], 5019);

0 commit comments

Comments
 (0)