From bfdc88c8e1aff413024ad60ea7a0c324d37b4024 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Tue, 27 Jun 2023 18:54:51 -0300 Subject: [PATCH] API/EnableArrayDimensions: fix CktElement_Get_NodeOrder; add to CktElement_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. --- README.md | 4 ++-- README.pt-BR.md | 3 ++- docs/changelog.md | 3 ++- src/CAPI/CAPI_CktElement.pas | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 884217523..5e9b7eef2 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/README.pt-BR.md b/README.pt-BR.md index 933239491..1de025c34 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -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. diff --git a/docs/changelog.md b/docs/changelog.md index 76f81441f..d4a7387ef 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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. @@ -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) diff --git a/src/CAPI/CAPI_CktElement.pas b/src/CAPI/CAPI_CktElement.pas index ebdabedb7..3ee747153 100644 --- a/src/CAPI/CAPI_CktElement.pas +++ b/src/CAPI/CAPI_CktElement.pas @@ -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; @@ -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