Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docgen/manuals/inputTables/gridDynGeneratorInputTable.tex
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
agccapble & flag & 0 & \\
indirect\_voltage\_control & flag & 0 & \\
\hline
\caption{Set options for gridDynGenerator objects. See Table~\ref{table:gridSecondary} for additional settable options through gridSecondary}
\caption{Set options for gridDynGenerator objects. See Table~\ref{table:gridSecondary} for additional settable options through GridSecondary}
\label{table:gridDynGenerator}
\end{longtable}
2 changes: 1 addition & 1 deletion docgen/manuals/inputTables/gridLoadInputTable.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
no\_pqvoltage\_limit & flag & 0 & \\
\hline
\end{tabular}
\caption{Set options for gridLoad objects. See Table~\ref{table:gridSecondary} for additional settable options through gridSecondary}
\caption{Set options for gridLoad objects. See Table~\ref{table:gridSecondary} for additional settable options through GridSecondary}
\label{table:gridLoad}
\end{table}
2 changes: 1 addition & 1 deletion docgen/manuals/inputTables/gridSecondaryInputTable.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
\hline
\hline
\end{tabular}
\caption{Set options for gridSecondary objects. See Table~\ref{table:gridObject} for additional settable options through gridObject}
\caption{Set options for GridSecondary objects. See Table~\ref{table:gridObject} for additional settable options through gridObject}
\label{table:gridSecondary}
\end{table}
2 changes: 1 addition & 1 deletion docgen/matlab/generateIOdocs.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
cls(nn).used=0;
end
%%
%order={'gridCoreObject','gridObject','gridPrimary','gridSecondary','gridSubModel'};
%order={'gridCoreObject','gridObject','gridPrimary','GridSecondary','gridSubModel'};
%saveDir='C:\Users\top1\Documents\codeProjects\transmission\docs\manuals\inputTables';
%generateLatexTables(cls,order,saveDir);
4 changes: 2 additions & 2 deletions docgen/matlab/getClassVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
function vArray=getClassVariables(cblock)
%function to extract the class variables from a code Block

vtypes={'double','coreTime','int','index_t','count_t','std::string'};
vtypes={'double','CoreTime','int','index_t','count_t','std::string'};
vArray=cell(0,4);
for vv=1:length(vtypes)
%get variables with comments
Expand Down Expand Up @@ -112,7 +112,7 @@
case {'kNullVal','kNullLocation','kInvalidLocation','kInvalidCount'}
val=nan;
otherwise
if (isequal(str(1:8),'coreTime'))
if (isequal(str(1:8),'CoreTime'))
try
val=eval(str(10:end-1));
catch
Expand Down
80 changes: 40 additions & 40 deletions docs/developer-guide/naming-inventory.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/developer-guide/naming-migration-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ Use this table to log each naming migration PR as it lands.

| PR / Branch | Area | Phase | Summary | Compatibility Needed | Tests Run | Status |
| ----------- | ----------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | -------------------------------------------------------- | -------- |
| merged | `src/griddyn/measurement` + `src/griddyn/primary` | Phase 9 | Final enforcement cleanup covering state-grabber lookup constant normalization, `AcBus`/`DcBus` factory and local naming fixes, header-definition parameter alignment, and the associated `clang-tidy` plus targeted `griddyn` rebuild follow-through | No | CI compile and `clang-tidy` run | Complete |
| merged | `src/core` + `src/fileInput` + `src/griddyn` + `src/griddyn_shared` + `test/` | Phase 9 | Final enforcement cleanup removing the remaining core/file-input/simulation compatibility type aliases, deleting the obsolete relay-message alias layer, fixing export-side `GridDynSimulation` ambiguity, and following through with targeted `griddyn` and component-test rebuilds | No | Targeted `griddyn` and `OptionalComponentTests` rebuilds | Complete |
| merged | `src/griddyn/controllers` + `src/griddyn/events` | Phase 9 | Final enforcement cleanup covering controller/event naming fallout in dispatcher, scheduler ramp/regulation, reversible-event helpers, member initialization, callback/signature alignment, and the associated `clang-tidy` plus targeted build follow-through | No | CI compile and `clang-tidy` run | Complete |
| merged | `src/fileInput` + `src/fmi` + `src/griddyn` + `src/runner` | Phase 9 | Final enforcement cleanup covering PSAT reader local naming, FMI and griddyn factory-registration globals, comms/controller registration normalization, redundant static-initialization suppression removal, and the associated `clang-tidy` and build follow-through | No | CI compile and `clang-tidy` run | Complete |
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Formatting conventions are primarily enforced through the repository
3. Class methods should be `camelCase`

```cpp
void setTime(coreTime newTime);
void setTime(CoreTime newTime);
```

Exception: methods that intentionally match standard library naming.
Expand Down
4 changes: 2 additions & 2 deletions src/core/CoreObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ CoreObject* CoreObject::findByUserID(std::string_view /*typeName*/, index_t sear
return nullptr;
}

void CoreObject::updateA(coreTime time)
void CoreObject::updateA(CoreTime time)
{
lastUpdateTime = time;
}
coreTime CoreObject::updateB()
CoreTime CoreObject::updateB()
{
assert(nextUpdateTime > negTime / 2.0); // The assert is to check for spurious calls
if (nextUpdateTime < maxTime) {
Expand Down
18 changes: 9 additions & 9 deletions src/core/CoreObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ class CoreObject {
index_t id = 0; //!< a user defined id for the object
CoreObject* parent = nullptr; //!< a pointer to the parent object
protected: // variables that are used regularly by child class objects
coreTime prevTime = negTime; //!<[s]the last state time of the object
coreTime nextUpdateTime = maxTime; //!<[s] the next scheduled update
coreTime lastUpdateTime = negTime; //!<[s] the last update time
coreTime updatePeriod = maxTime; //!<[s]the update period
coreTime updateDelay = timeZero; //!<[s]the requested delay between updateA and
CoreTime prevTime = negTime; //!<[s]the last state time of the object
CoreTime nextUpdateTime = maxTime; //!<[s] the next scheduled update
CoreTime lastUpdateTime = negTime; //!<[s] the last update time
CoreTime updatePeriod = maxTime; //!<[s]the update period
CoreTime updateDelay = timeZero; //!<[s]the requested delay between updateA and
//!< updateB--requested is key here not guaranteed
private:
// these shouldn't generate false sharing as one is static
Expand Down Expand Up @@ -234,11 +234,11 @@ class CoreObject {
a later time
* @param[in] time the times to update the object to
*/
virtual void updateA(coreTime time);
virtual void updateA(CoreTime time);
/**
* @brief the B update function for update calls with two parts
*/
virtual coreTime updateB();
virtual CoreTime updateB();
/**
* @brief function to enable the object, most objects are enabled by default
*/
Expand Down Expand Up @@ -317,11 +317,11 @@ class CoreObject {
virtual void setUpdateTime(double newUpdateTime);
/** @brief get the next time the system should call the update functions
*/
coreTime getNextUpdateTime() const noexcept { return nextUpdateTime; }
CoreTime getNextUpdateTime() const noexcept { return nextUpdateTime; }

/**@brief return the last time the object had its state set or was updated
*/
coreTime currentTime() const noexcept { return prevTime; }
CoreTime currentTime() const noexcept { return prevTime; }
friend void removeReference(CoreObject* objToDelete);
friend void removeReference(CoreObject* objToDelete, const CoreObject* parent);
friend bool compareUpdates(const CoreObject* o1, const CoreObject* o2);
Expand Down
20 changes: 10 additions & 10 deletions src/core/coreDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,23 @@ enum class PrintLevel : int {
using id_type_t = std::int64_t;

constexpr auto invalid_id_value = std::numeric_limits<id_type_t>::min();
using coreTime = TimeRepresentation<count_time<9>>;
using CoreTime = TimeRepresentation<count_time<9>>;
using stringVec = std::vector<std::string>;

/** commonly used time expressions*/
constexpr coreTime maxTime = coreTime::maxVal();
constexpr coreTime negTime = coreTime::minVal();
constexpr coreTime timeZero = coreTime::zeroVal();
constexpr CoreTime maxTime = CoreTime::maxVal();
constexpr CoreTime negTime = CoreTime::minVal();
constexpr CoreTime timeZero = CoreTime::zeroVal();

constexpr coreTime timeOneSecond(1.0);
constexpr CoreTime timeOneSecond(1.0);

constexpr coreTime kDayLength(86400.0f);
constexpr coreTime kSmallTime(1e-7);
constexpr coreTime kShortTime(1e-6);
constexpr CoreTime kDayLength(86400.0f);
constexpr CoreTime kSmallTime(1e-7);
constexpr CoreTime kShortTime(1e-6);

constexpr coreTime operator""_t(long double val)
constexpr CoreTime operator""_t(long double val)
{
return coreTime(val);
return CoreTime(val);
}

// create an inline check for valid indices
Expand Down
4 changes: 2 additions & 2 deletions src/extraModels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# SPDX-License-Identifier: BSD-3-Clause
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set(extra_sources extraModels.cpp txThermalModel.cpp txLifeSpan.cpp)
set(extra_sources extraModels.cpp TxThermalModel.cpp TxLifeSpan.cpp)

set(extra_headers extraModels.h txThermalModel.h txLifeSpan.h)
set(extra_headers extraModels.h TxThermalModel.h TxLifeSpan.h)

add_library(extraModelLibrary STATIC ${extra_sources} ${extra_headers})
set_target_properties(extraModelLibrary PROPERTIES FOLDER libraries)
Expand Down
34 changes: 17 additions & 17 deletions src/extraModels/txLifeSpan.cpp → src/extraModels/TxLifeSpan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "txLifeSpan.h"
#include "TxLifeSpan.h"

#include "core/CoreExceptions.h"
#include "core/CoreObjectTemplates.hpp"
Expand All @@ -20,17 +20,17 @@
#include <utility>

namespace griddyn::extra {
txLifeSpan::txLifeSpan(const std::string& objName): Sensor(objName)
TxLifeSpan::TxLifeSpan(const std::string& objName): Sensor(objName)
{
opFlags.reset(CONTINUOUS_FLAG); // this is a not a continuous model everything is slow so
// no need to make it continuous
outputStrings = {{"remaininglife", "liferemaining"}, {"lossoflife"}, {"rate", "rateofloss"}};
m_outputSize = 3;
}

CoreObject* txLifeSpan::clone(CoreObject* obj) const
CoreObject* TxLifeSpan::clone(CoreObject* obj) const
{
auto* nobj = cloneBase<txLifeSpan, Sensor>(this, obj);
auto* nobj = cloneBase<TxLifeSpan, Sensor>(this, obj);
if (nobj == nullptr) {
return obj;
}
Expand All @@ -42,7 +42,7 @@ CoreObject* txLifeSpan::clone(CoreObject* obj) const
return nobj;
}

void txLifeSpan::setFlag(std::string_view flag, bool val)
void TxLifeSpan::setFlag(std::string_view flag, bool val)
{
if ((flag == "useiec") || (flag == "iec")) {
opFlags.set(useIECmethod, val);
Expand All @@ -55,15 +55,15 @@ void txLifeSpan::setFlag(std::string_view flag, bool val)
}
}

void txLifeSpan::set(std::string_view param, std::string_view val)
void TxLifeSpan::set(std::string_view param, std::string_view val)
{
if (param.empty() || param[0] == '#') {
} else {
Sensor::set(param, val);
}
}

void txLifeSpan::set(std::string_view param, double val, units::unit unitType)
void TxLifeSpan::set(std::string_view param, double val, units::unit unitType)
{
if ((param == "initial") || (param == "initiallife")) {
mInitialLife = units::convert(val, unitType, units::hr);
Expand All @@ -76,17 +76,17 @@ void txLifeSpan::set(std::string_view param, double val, units::unit unitType)
}
}

double txLifeSpan::get(std::string_view param, units::unit unitType) const
double TxLifeSpan::get(std::string_view param, units::unit unitType) const
{
return Sensor::get(param, unitType);
}

void txLifeSpan::add(CoreObject* /*obj*/)
void TxLifeSpan::add(CoreObject* /*obj*/)
{
throw(UnrecognizedObjectException(this));
}

void txLifeSpan::dynObjectInitializeA(coreTime time0, std::uint32_t flags)
void TxLifeSpan::dynObjectInitializeA(CoreTime time0, std::uint32_t flags)
{
if (m_sourceObject == nullptr) {
Sensor::dynObjectInitializeA(time0, flags);
Expand All @@ -95,11 +95,11 @@ void txLifeSpan::dynObjectInitializeA(coreTime time0, std::uint32_t flags)

if (updatePeriod > negTime) { // set the period to the period of the simulation to at least
// 1/5 the winding time constant
coreTime simulationStep = getRoot()->get("steptime");
CoreTime simulationStep = getRoot()->get("steptime");
if (simulationStep < timeZero) {
simulationStep = 1.0;
}
const coreTime modelTimestep = 120.0; // update once per minute
const CoreTime modelTimestep = 120.0; // update once per minute
updatePeriod = simulationStep * std::floor(modelTimestep / simulationStep);
if (updatePeriod < simulationStep) {
updatePeriod = simulationStep;
Expand Down Expand Up @@ -154,7 +154,7 @@ void txLifeSpan::dynObjectInitializeA(coreTime time0, std::uint32_t flags)
}
Sensor::dynObjectInitializeA(time0, flags);
}
void txLifeSpan::dynObjectInitializeB(const IOdata& inputs,
void TxLifeSpan::dynObjectInitializeB(const IOdata& inputs,
const IOdata& desiredOutput,
IOdata& fieldSet)
{
Expand All @@ -166,7 +166,7 @@ void txLifeSpan::dynObjectInitializeB(const IOdata& inputs,
// initializing the blocks here
}

void txLifeSpan::updateA(coreTime time)
void TxLifeSpan::updateA(CoreTime time)
{
if (time == prevTime) {
return;
Expand All @@ -184,15 +184,15 @@ void txLifeSpan::updateA(coreTime time)
prevTime = time;
}

void txLifeSpan::timestep(coreTime time, const IOdata& /*inputs*/, const SolverMode& /*sMode*/)
void TxLifeSpan::timestep(CoreTime time, const IOdata& /*inputs*/, const SolverMode& /*sMode*/)
{
updateA(time);
}

void txLifeSpan::actionTaken(index_t actionNumber,
void TxLifeSpan::actionTaken(index_t actionNumber,
index_t /*conditionNum*/,
ChangeCode /*actionReturn*/,
coreTime /*actionTime*/)
CoreTime /*actionTime*/)
{
if (m_sinkObject != nullptr) {
if (actionNumber == 0) {
Expand Down
12 changes: 6 additions & 6 deletions src/extraModels/txLifeSpan.h → src/extraModels/TxLifeSpan.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace griddyn::extra {
/** @brief class modeling a transformer lifespan based on thermal effects
*/
class txLifeSpan: public Sensor {
class TxLifeSpan: public Sensor {
public:
enum LifespanModelFlags {
useIECmethod = object_flag11,
Expand All @@ -32,7 +32,7 @@ class txLifeSpan: public Sensor {
double mAgingAccelerationFactor = 0.0;

public:
txLifeSpan(const std::string& objName = "txlifeSpan_$");
TxLifeSpan(const std::string& objName = "txlifeSpan_$");
CoreObject* clone(CoreObject* obj = nullptr) const override;
virtual void setFlag(std::string_view flag, bool val = true) override;
virtual void set(std::string_view param, std::string_view val) override;
Expand All @@ -44,18 +44,18 @@ class txLifeSpan: public Sensor {
virtual double get(std::string_view param,
units::unit unitType = units::defunit) const override;

virtual void dynObjectInitializeA(coreTime time0, std::uint32_t flags) override;
virtual void dynObjectInitializeA(CoreTime time0, std::uint32_t flags) override;
virtual void dynObjectInitializeB(const IOdata& inputs,
const IOdata& desiredOutput,
IOdata& fieldSet) override;

virtual void timestep(coreTime time, const IOdata& inputs, const SolverMode& sMode) override;
virtual void updateA(coreTime time) override;
virtual void timestep(CoreTime time, const IOdata& inputs, const SolverMode& sMode) override;
virtual void updateA(CoreTime time) override;

void actionTaken(index_t actionNumber,
index_t conditionNum,
ChangeCode actionReturn,
coreTime /*actionTime*/) override;
CoreTime /*actionTime*/) override;
};

} // namespace griddyn::extra
Loading
Loading