Skip to content

Commit

Permalink
API/EnableArrayDimensions: fix CktElement_Get_NodeOrder; add to CktEl…
Browse files Browse the repository at this point in the history
…ement_Get_Powers

- `NodeOrder` had the number of rows exchanged with the number of columns.
- `Powers` did not have the matrix shape before, added and tested.
  • Loading branch information
PMeira committed Jun 27, 2023
1 parent 795ff04 commit 787328a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Versions 0.13.x

## Version 0.13.4 (2023-06-26)
## Version 0.13.4 (2023-06-27)

Bugfix release for `CapControl`, couple with some incremental improvements.

Expand All @@ -29,6 +29,7 @@ This version should match OpenDSS v9.6.1.3 (SVN r3623).
- Added `DSSEvents`: Implement an initial set of functions analog to the COM interface. This was added for historical compatibility since use of `DSSEvents` is rarely seen. [This document from EPRI (2011)](https://restservice.epri.com/publicdownload/000000000001020090/0/Product) presents the equivalent in the COM interface. Examples will be added in our downstream projects when time allows (feel free to request one to signal interest in this feature).
- Handle better how the internal `SolutionAbort` is used. Some invalid states where not being handled on absence of float-point exceptions, leading to potential useless results (NaN) and even crashes.
- `VSource`: Abort the solution if Z1 is zero.
- API/ArrayDimensions: fix `CktElement_Get_NodeOrder`; add to `CktElement_Get_Powers`.

## Version 0.13.3 (2023-06-11)

Expand Down
4 changes: 2 additions & 2 deletions src/CAPI/CAPI_CktElement.pas
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ procedure CktElement_Get_Powers(var ResultPtr: PDouble; ResultCount: PAPISize);
with DSSPrime.ActiveCircuit.ActiveCktElement do
begin
NValues := NConds * Nterms;
Result := DSS_RecreateArray_PDouble(ResultPtr, ResultCount, 2 * NValues);
Result := DSS_RecreateArray_PDouble(ResultPtr, ResultCount, 2 * NValues, NConds, NTerms);
GetPhasePower(pComplexArray(ResultPtr));
for i := 0 to (2 * NValues - 1) do
Result[i] *= 0.001;
Expand Down Expand Up @@ -1276,7 +1276,7 @@ procedure CktElement_Get_NodeOrder(var ResultPtr: PInteger; ResultCount: PAPISiz
Exit;
end;

Result := DSS_RecreateArray_PInteger(ResultPtr, ResultCount, NTerms * Nconds, Nconds, NTerms);
Result := DSS_RecreateArray_PInteger(ResultPtr, ResultCount, NTerms * Nconds, NTerms, Nconds);
k := 0;
for i := 1 to Nterms do
begin
Expand Down

0 comments on commit 787328a

Please sign in to comment.