Skip to content

Commit

Permalink
LineGeometry/API: use actual number of conductors, not the reduced va…
Browse files Browse the repository at this point in the history
  • Loading branch information
PMeira committed Mar 27, 2024
1 parent 5b5f024 commit 7407fda
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/CAPI/CAPI_LineGeometries.pas
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function LineGeometries_Get_Nconds(): Integer; CDECL;
if not _activeObj(DSSPrime, pLineGeometry) then
Exit;

Result := pLineGeometry.Nconds;
Result := pLineGeometry.FNconds;
end;
//------------------------------------------------------------------------------
procedure LineGeometries_Set_Nconds(Value: Integer); CDECL;
Expand Down Expand Up @@ -391,9 +391,9 @@ procedure LineGeometries_Set_Units(ValuePtr: PInteger; ValueCount: TAPISize); CD
begin
if not _activeObj(DSSPrime, pLineGeometry) then
Exit;
if pLineGeometry.Nconds <> ValueCount then
if pLineGeometry.FNconds <> ValueCount then
begin
DoSimpleMsg(DSSPrime, 'The number of values provided (%d) does not match the number of conductors (%d).', [ValueCount, pLineGeometry.NConds], 183);
DoSimpleMsg(DSSPrime, 'The number of values provided (%d) does not match the number of conductors (%d).', [ValueCount, pLineGeometry.FNConds], 183);
Exit;
end;
Move(ValuePtr[0], pLineGeometry.FUnits[1], ValueCount * SizeOf(Double));
Expand All @@ -410,8 +410,8 @@ procedure LineGeometries_Get_Units(var ResultPtr: PInteger; ResultCount: PAPISiz
DefaultResult(ResultPtr, ResultCount);
Exit;
end;
DSS_RecreateArray_PInteger(Result, ResultPtr, ResultCount, pLineGeometry.Nconds);
Move(pLineGeometry.FUnits[1], ResultPtr[0], pLineGeometry.Nconds * SizeOf(Integer));
DSS_RecreateArray_PInteger(Result, ResultPtr, ResultCount, pLineGeometry.FNconds);
Move(pLineGeometry.FUnits[1], ResultPtr[0], pLineGeometry.FNconds * SizeOf(Integer));
end;

procedure LineGeometries_Get_Units_GR(); CDECL;
Expand All @@ -427,9 +427,9 @@ procedure LineGeometries_Set_Ycoords(ValuePtr: PDouble; ValueCount: TAPISize); C
begin
if not _activeObj(DSSPrime, pLineGeometry) then
Exit;
if pLineGeometry.Nconds <> ValueCount then
if pLineGeometry.FNconds <> ValueCount then
begin
DoSimpleMsg(DSSPrime, 'The number of values provided (%d) does not match the number of conductors (%d).', [ValueCount, pLineGeometry.NConds], 188);
DoSimpleMsg(DSSPrime, 'The number of values provided (%d) does not match the number of conductors (%d).', [ValueCount, pLineGeometry.FNConds], 188);
Exit;
end;
Move(ValuePtr[0], pLineGeometry.FY[1], ValueCount * SizeOf(Double));
Expand All @@ -446,8 +446,8 @@ procedure LineGeometries_Get_Ycoords(var ResultPtr: PDouble; ResultCount: PAPISi
DefaultResult(ResultPtr, ResultCount);
Exit;
end;
DSS_RecreateArray_PDouble(Result, ResultPtr, ResultCount, pLineGeometry.Nconds);
Move(pLineGeometry.FY[1], ResultPtr[0], pLineGeometry.Nconds * SizeOf(Double));
DSS_RecreateArray_PDouble(Result, ResultPtr, ResultCount, pLineGeometry.FNconds);
Move(pLineGeometry.FY[1], ResultPtr[0], pLineGeometry.FNconds * SizeOf(Double));
end;

procedure LineGeometries_Get_Ycoords_GR(); CDECL;
Expand All @@ -463,9 +463,9 @@ procedure LineGeometries_Set_Xcoords(ValuePtr: PDouble; ValueCount: TAPISize); C
begin
if not _activeObj(DSSPrime, pLineGeometry) then
Exit;
if pLineGeometry.Nconds <> ValueCount then
if pLineGeometry.FNconds <> ValueCount then
begin
DoSimpleMsg(DSSPrime, 'The number of values provided (%d) does not match the number of conductors (%d).', [ValueCount, pLineGeometry.NConds], 187);
DoSimpleMsg(DSSPrime, 'The number of values provided (%d) does not match the number of conductors (%d).', [ValueCount, pLineGeometry.FNConds], 187);
Exit;
end;
Move(ValuePtr[0], pLineGeometry.FX[1], ValueCount * SizeOf(Double));
Expand All @@ -482,8 +482,8 @@ procedure LineGeometries_Get_Xcoords(var ResultPtr: PDouble; ResultCount: PAPISi
DefaultResult(ResultPtr, ResultCount);
Exit;
end;
DSS_RecreateArray_PDouble(Result, ResultPtr, ResultCount, pLineGeometry.Nconds);
Move(pLineGeometry.FX[1], ResultPtr[0], pLineGeometry.Nconds * SizeOf(Double));
DSS_RecreateArray_PDouble(Result, ResultPtr, ResultCount, pLineGeometry.FNconds);
Move(pLineGeometry.FX[1], ResultPtr[0], pLineGeometry.FNconds * SizeOf(Double));
end;

procedure LineGeometries_Get_Xcoords_GR(); CDECL;
Expand All @@ -505,8 +505,8 @@ procedure LineGeometries_Get_Conductors(var ResultPtr: PPAnsiChar; ResultCount:
Exit;
end;

DSS_RecreateArray_PPAnsiChar(Result, ResultPtr, ResultCount, pLineGeometry.Nconds);
for i := 1 to pLineGeometry.Nconds do
DSS_RecreateArray_PPAnsiChar(Result, ResultPtr, ResultCount, pLineGeometry.FNconds);
for i := 1 to pLineGeometry.FNconds do
Result[i - 1] := DSS_CopyStringAsPChar(pLineGeometry.ConductorName[i]);
end;

Expand Down

0 comments on commit 7407fda

Please sign in to comment.