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 bfdc88c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Since 2019-03-05, the `dss_capi` repository contains all the Pascal code used to

See [the changelog](https://github.com/dss-extensions/dss_capi/blob/master/docs/changelog.md) for a detailed list.

- **2023-06-26 / version 0.13.4: Bugfix release (CapControl), incremental improvements. See the changelog or release page for details.**
- 2023-06-11 / version 0.13.3: Bugfix release for some components (notably Capacitor, Reactor, UPFC). See the changelog or release page for details.
- **2023-06-27 / version 0.13.4: Bugfix release (CapControl), incremental improvements. See the changelog or release page for details.**
- 2023-06-11 / version 0.13.3: Bugfix release for some components (notably Capacitor, Reactor, UPFC).
- 2023-05-24 / version 0.13.2: Minor release, includes updates to JSON exports, some more error-checking, internal code refactoring, header updates, and minor ports from the official OpenDSS.
- 2023-04-01 / version 0.13.1: Minor release to address a few PVSystem properties
- 2023-03-29 / version 0.13.0: Various updates, including bugfixes and several OpenDSS feature ports; the reference is now OpenDSS v9.6.1.1.
Expand Down
3 changes: 2 additions & 1 deletion README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ A partir de 2019-03-05, este repositório contém todo o código fonte em lingua

Veja o [registro de alterações (em inglês)](https://github.com/dss-extensions/dss_capi/blob/master/docs/changelog.md) para listagem detalhada.

- **2023-06-11 / version 0.13.3: Correção de bugs em alguns dos componentes (em especial Capacitor, Reactor, UPFC). Veja o changelog para mais informações.**
- **2023-06-27 / version 0.13.4: Correção de bugs (CapControl), melhorias incrementais.**
- 2023-06-11 / version 0.13.3: Correção de bugs em alguns dos componentes (em especial Capacitor, Reactor, UPFC).
- 2023-05-24 / versão 0.13.2: Melhorias para exportação JSON, verificação de erros, refatoração do código interno, e port de algumas mudanças menores do OpenDSS oficial.
- 2023-04-01 / versão 0.13.1: Traz apenas algumas potenciais correções relacionadas a 3 propriedades de PVSystem
- 2023-03-29 / versão 0.13.0: Várias melhorias, incluindo correção de bugs e portes de várias modificações do OpenDSS oficial; a referência para esta versão é o OpenDSS v9.6.1.1.
Expand Down
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 bfdc88c

Please sign in to comment.